# Embed BabelShark script

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

<figure><img src="https://1290550914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUf86Tx3GrUXukSHhL9ht%2Fuploads%2FDVzSwTTxhCofzfh2G2Zq%2Fimage.png?alt=media&#x26;token=0593e7b7-7a06-4975-b2c7-ead7196759ff" 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](https://docs.babelshark.net/dev/api-reference/babelshark-config).

### 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="https://1290550914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUf86Tx3GrUXukSHhL9ht%2Fuploads%2F2n728ahfkYnzZg2x4JrS%2Fimage.png?alt=media&#x26;token=bc83ef79-56fa-4316-bfa6-fe3cbedc94d6" 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="https://1290550914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUf86Tx3GrUXukSHhL9ht%2Fuploads%2F2dTmzJE0tpZqaRHNr8Rx%2Fimage.png?alt=media&#x26;token=cc435e62-4ef3-4935-b55f-d9b40c7aec20" alt="" width="375"><figcaption></figcaption></figure>

Read about language widget configuration in [API Reference](https://docs.babelshark.net/dev/api-reference/language-drop-down-specs).


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
