> For the complete documentation index, see [llms.txt](https://docs.babelshark.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.babelshark.net/dev/embed-babelshark-script.md).

# Embed BabelShark script

BabelShark requires a "code snippet", a single .js script to be embedded into your page:

<figure><img src="/files/APLjy2Qrl2GCReZVhh9e" alt=""><figcaption><p>Add this code to your HTML, to &#x3C;head> preferably</p></figcaption></figure>

Read more about configuration object at [API Reference page](/dev/api-reference/babelshark-config.md).

### Language dropdown

You probably also want a language-selection dropdown somewhere on the page (you can use API to switch languages but built-in dropdown is a good start):

<figure><img src="/files/d2IywWZzXPR8zLJnErIT" alt=""><figcaption></figcaption></figure>

This snippet should be added exactly where you want a language dropdown to reside. BabelShark.js will turn this snippet to a language flag button and a dropdown:

<figure><img src="/files/kHoovGHJzbMgS1DPzJat" alt="" width="375"><figcaption></figcaption></figure>

Read about language widget configuration in [API Reference](/dev/api-reference/language-drop-down-specs.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.babelshark.net/dev/embed-babelshark-script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
