> For the complete documentation index, see [llms.txt](https://play.docs.nexx.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://play.docs.nexx.cloud/widgets/javascript-sdk.md).

# Javascript SDK

After the nexxPLAY SDK is ready, the Frontend can embed as many Widget Containers on the Frontend as desired.

```javascript
_play.control.addWidget(CONTAINER-ID, WIDGET-HASH, WIDGET-STREAMTYPE, CONFIG);
```

{% hint style="info" %}
**CONTAINER-ID** is the id of the target Container on the Page, that the Widget will be inserted into. Please notice, that the Container should have a given width/height in either inline CSS or by a CSS Document to allow the Widget to measure its Dimensions.
{% endhint %}

{% hint style="info" %}
**WIDGET-HASH** is the Reference Hash of an existing AutoExport Widget within nexxOMNIA
{% endhint %}

{% hint style="info" %}
**WIDGET-SECRET** is an optional Security Mechanism, that can be enabled within nexxOMNIA
{% endhint %}

The mentioned **`CONFIG`** is similar to nexxPLAY a Configuration Object, but of Type **`WidgetConfiguration`**.

```javascript
var obj = { feedUpdateInterval: 30, slideUpdateInterval:10 };
var cfg = new _play.WidgetConfiguration(obj);
cfg.addOverride("animation", "zoom");

var widget = _play.control.addWidget("div", "HASH", "SECRET", cfg);
```

You can find a List of all available Override Options here:

{% content-ref url="/pages/-MC-gDOXnzwDKsA-5gZm" %}
[Widget Override Options](/widgets/widget-override-options.md)
{% endcontent-ref %}

The **`addWidget`** Method will return a **`_play.WidgetInstance`** Object, which can be used to control the Widget via JavaScript after Initialization.


---

# 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://play.docs.nexx.cloud/widgets/javascript-sdk.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.
