HOSTED SPACES
App documentation widget
9min
contextual documentation is embedded within your product where the user needs it most the contextual docs widget helps users read the documentation without the need to browse the user guide portal in another window you can load specific articles or the entire user guide portal, which is a must have for companies who want to increase product adoption and retention all you need to do is embed the html code generated under space settings > widget integration how the widget works check out the video below showing the widget in action how to implement the widget to integrate the widget, follow these steps select your space inside the editor click on the gear icon (⚙️) to get into settings go to widget integration click on the copy button, and paste the code into your index html file, or in your application code now, the widget will handle everything behind the scenes don't worry, everything is bundled and minified it's a mere 56kb download and it loads asynchronously, so your users won't feel a difference init event in the init event, for the spaceid value, you can use the spaceid or the published {spaceid} this way you can use spaces without publishing them, straight in your app use preview {spaceid} when you only want to publish a space to preview and not on your domain property type description required spaceid string pass the desired id to load your docs required jwt string pass the jwt token in order to see jwt protected docs optional shareabletoken string pass the shareabletoken from your private links to protect your docs optional widgettype 'docs' | 'search' default value is docs this opens the widget with the desired behaviour docs type will open the widget with the default behaviour, search will open a search widget bar that shows a search bar with ai support (if included in your subscription) optional hidenavbar boolean it shows or hides the top navbar from the widget modal by default the navbar is visible if you don't want to see the navbar, pass it with true value, otherwise just skip it loadingstrategy lazy | eager the default value is lazy while lazy loading delays the initialization of a resource, eager loading initializes or loads the widget as soon as the code is executed optional bubble invisible | ask the default value is invisible if set to ask it will display a bubble in the bottom right of your screen whenever someone clicks on it, the search widget will open optional bubbleplaceholder string the placeholder that will be displayed in the bubble section if not passed, a default value of ask a question will be displayed optional anchor string you can provide your class , id or path to a dom element where you would like the widget to anchor and instantiate it will anchor to the first element found in the dom, if multiple elements with the same path are present the container provided should have position relative as the widget will be displayed based on the first relative parent found e g , anchor "#my container" / anchor " container class" optional if you want a simple search bubble to always be present in your app, use the bubble "ask" prop show widget event show widget event triggers the action to display the widget it also has an optional property that you can pass to open a specific document from your initialized spaces property description required docid set the doc id value to open a specific document if docid is passed, widgettype is ignored, it will open in docs mode regardless of the prop passed note you must add the word published in front of the docid as published docid or preview spaceid ; otherwise, the widget will open the document from edit mode that might have unpublished changes optional blockid set a certain block id, in order to scroll to the desired section in that document optional supported events here is a brief description of our widget event api event name description required init this event helps archbee widget boostrap required files into your app required show widget this event displays the widget on demand required hide widget this event hides the widget if built in mechanics are not enough optional code samples add a function wherever you want to display the widget on your site, like this const openabwidget = () => { window archbee push({ eventtype "show widget", // optional, only for loading a specific doc // and scroll to section // docid `published ${docid}`, // blockid "tbmm9" }); } this will load the widget, with the desired space docs and users will be able to see everything straight from your app if you want to load a specific doc only, just pass docid `${docid}` to our initial object as in the example above you don't need the closewidget function, since the widget will automatically close if you press esc or click outside of it however, if you want to close the widget programatically and not rely on the built in close mechanics, you can use hide widget event type this way const closeabwidgetafterseconds = (miliseconds) => { settimeout(() => { // settimeout is for demo purposes and it is not required window archbee push({eventtype "hide widget"}); }, miliseconds); } closeabwidgetafterseconds(5000);
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.