# Using Annoto Widget API

In [Customise Annoto Widget configuration](/developers/kaltura-plugin-v2/customise-annoto-widget-configuration.md) we have learned how to listen to Kaltura player events and get access to the widget [configuration](/developers/widget/getting-started.md#configuration) and the [API](/developers/widget/getting-started.md#using-the-api):

```javascript
kWidget.addReadyCallback(function (playerId) {
        player.kBind('annotoPluginReady', function (annotoApi) {
                // Make use of the Annoto API
        });
});
```

The `annotoApi` can be used to accomplish various tasks such as dynamically hide/show the widget, load new configuration and maybe the most common task to perform Single Sign On (SSO) authentication:

```javascript
var userJwtToken = '....';
player.kBind('annotoPluginReady', function (annotoApi) {
    // Make use of the Annoto API
    // If we already have the userJwtToken use it,
    // alternatively the annotoAPI can be saved in a variable
    // and used asynchronously.
    annotoApi.auth(userJwtToken).catch(function(err) {
        console.error('Annoto SSO auth error: ', err);
    });
});
```

{% hint style="success" %}
For more information regarding SSO, please refer to the Annoto SSO Technical Guide or contact us at <support@annoto.net>.
{% endhint %}


---

# 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.annoto.net/developers/kaltura-plugin-v2/using-annoto-widget-api.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.
