> For the complete documentation index, see [llms.txt](https://docs.videsk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videsk.io/es-developers/widgets/api/introduccion.md).

# Introducción

Nuestro producto Widget tiene la capacidad de ser interactuado mediante su propia API. Esto permite a los desarrolladores personalizar su comportamiento basado en eventos o funciones dispuestas para ellos.

Para acceder a la API se debe usar la variable global:

```javascript
videsk
// Or
window.videsk

// Example
videsk.toggle();
// Or
window.videsk.toggle();
```

### Activar modo debug

Para activar el modo debug deberás asignar el valor `true`a la variable global `__VIDESK_WIDGET_DEBUG__` antes de cargar el `script`.

```javascript
window.__VIDESK_WIDGET_DEBUG__ = true;
```

Esto permitirá mostrar en consola información del estado de los eventos y estado de las funciones, cada uno con sus valores de retorno correspondientes.

{% hint style="danger" %}
**No olvides eliminar el modo debug en modo producción.**
{% endhint %}

A continuación se describe el uso de los eventos y funciones disponibles como API.

{% hint style="info" %}
Antes de comenzar recuerda el uso de la variable global `videsk` como acceso a la Widget API.
{% endhint %}

{% content-ref url="/pages/V1pNw6WVyXOmHmnGuLPm" %}
[Variables globales](/es-developers/widgets/api/variables-globales.md)
{% endcontent-ref %}

{% content-ref url="/pages/yYrU57aeqY25PTkep4G8" %}
[Métodos](/es-developers/widgets/api/metodos.md)
{% endcontent-ref %}

{% content-ref url="/pages/wXdqAe5Z96IilmH8bh1S" %}
[Eventos](/es-developers/widgets/api/eventos.md)
{% endcontent-ref %}

{% content-ref url="/pages/61SYFxrk1QLjoHF6OWB0" %}
[Ajustes](/es-developers/widgets/api/diseno.md)
{% endcontent-ref %}


---

# 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://docs.videsk.io/es-developers/widgets/api/introduccion.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.
