Script tag
Learn how to add the Docs Embed widget to any website or web app using a single script tag
Get started
2
3
Optionally configure the embed
<script src="https://YOUR_DOCS_DOMAIN/~gitbook/embed/script.js"></script>
<script>
window.GitBook('configure', {
button: {
label: 'Ask',
icon: 'assistant' // assistant | sparkle | help | book
},
trademark: false,
tabs: ['assistant', 'search', 'docs'],
actions: [
{
icon: 'circle-question',
label: 'Contact support',
onClick: () => window.open('https://support.example.com', '_blank')
}
],
greeting: {
title: 'Welcome',
subtitle: 'How can I help?'
},
assistantName: 'Support Copilot',
closeButton: true,
suggestions: [
'What is GitBook?',
'How do I get started?'
]
});
window.GitBook('show');
</script>Set the color scheme
Control widget visibility
Navigate and interact programmatically
Load the embed script dynamically
API Reference
Initialization
Widget Control
Navigation
Chat
Configuration
Configuration Options
GitBook('configure')
tabs
actions
greeting
assistantName
closeButton
suggestions
trademark
tools
button
frameOptions
colorScheme
visitor (Authenticated Access)
Common pitfalls
Last updated
Was this helpful?