Integrate via Script
Install the SnippetAI web component via a script tag. This is useful for doc providers that don’t allow adding custom script tags but do allow custom JS.
For React environments or when custom script tags are available, refer to Integrate via React or Integrate via Web Component which are preferred.
Required Steps
Add the two components to your documentation site;
- A button with an HTML ID that you want to trigger the component
- The script tag to mount the web component
Below is an example minimal HTML installation.
In the above script you can configure your component by adjusting the following HTML attributes
Attribute
Description
Your public API key for authentication
Required
Yes
Default
—
Description
Programming language for code generation (
,
,
,
,
,
)
Required
No
Default
—
Description
Custom ID attribute for a button element that will open SnippetAI when clicked
Required
No
Default
—
Description
Keyboard shortcut to open the Command Bar
Required
No
Default
(cmd+k / ctrl+k)
Description
Z-index of the command bar
Required
No
Default
Description
Searchable list of suggestions for the command bar
Required
No
Default
Last updated on