> For the complete documentation index, see [llms.txt](https://docs.annoto.net/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.annoto.net/developers/kaltura-plugin-v2/using-annoto-widget-api.md).

# 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 %}
