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
},
tabs: ['assistant', '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>Control widget visibility
Navigate and interact programmatically
Load the embed script dynamically
API Reference
Initialization
Widget Control
Navigation
Chat
Configuration
Configuration Options
tabs
tabsactions
actionsgreeting
greetingsuggestions
suggestionstools
toolsbutton
buttonvisitor (Authenticated Access)
visitor (Authenticated Access)Common pitfalls
Last updated
Was this helpful?