> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/cms/javascript/javascript.md).

# Getting Started

Get Started with Weglot library

## Getting started

Let's include Weglot's client code into your site and get started with translations.

1. Go to your Weglot dashboard (<https://dashboard.weglot.com/>) , start a new project. Depending on the technology you chose, you will integrate Weglot using the Javascript library.
2. Edit your HTML file, and right before the`</head>`tag, append the code that is shown to you. It should look like:

```markup
<script type="text/javascript" src="https://cdn.weglot.com/weglot.min.js"></script>
<script>
    Weglot.initialize({
        api_key: 'YOUR_API_KEY'
    });
</script>
```

Make sure you replace `YOUR_API_KEY`with the API key you got in the step one.

Your API key is then used to retrieve the settings of your project from your Weglot dashboard, like the original language, the languages you want to translated into, the things you don't want to translated etc...

* Add more settings in this object, [see the options page](https://developers.weglot.com/cms/javascript/options.md).
* Interact with the `Weglot` instance, [see available methods](https://developers.weglot.com/cms/javascript/javascript-functions.md).
* Design your own switcher, move it in your page: [go to the link hooks guide](https://developers.weglot.com/cms/javascript/link-hooks.md).
* You can also [translate an iframe](https://developers.weglot.com/cms/javascript/translate-iframe.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.weglot.com/cms/javascript/javascript.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
