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?'
},
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')
GitBook('configure')tabs
tabsactions
actionsgreeting
greetingsuggestions
suggestionstrademark
trademarktools
toolsbutton
buttonframeOptions
frameOptionscolorScheme
colorSchemevisitor (Authenticated Access)
visitor (Authenticated Access)Common pitfalls
Last updated
Was this helpful?