> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk-1/actions.md).

# Actions

Follow the retained actions workflow for the deprecated unscoped Web SDK, or move to the current Convai Web SDK action event and configuration surface.

{% hint style="warning" %}
**Deprecated on August 26, 2026.** The unscoped `convai-web-sdk` package is no longer supported. Migrate to [Actions in the current Convai Web SDK](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/actions.md). This page remains available for historical reference and is not maintained.
{% endhint %}

To set up the Actions you need to follow the following steps:

1. Sign in to [Convai's website](https://convai.com/) and navigate to your Character Details.
2. Navigate to Actions, enable the Action Generation and select the actions you want your NPC to perform.
3. Go back to your code and Initialize an actionText state that will store the action that you want NPC to perform.

```javascript
const [actionText, setActionText] = useState("");
```

3. Inside the same useEffect where we check the audio response. Refer to the [Getting Started](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk-1/getting-started.md) page to quickly understand how and where we check audio response.

```javascript
useEffect(()=>{

------------------------------------------------------------------------
//First Initialize Convai Client here. Refer Getting Started Page
//setResponseCallback method to be called after initializing the client
//onAudioPlay and onAudioStop methods need to be setup
------------------------------------------------------------------------

if (response.hasActionResponse()) {
        let actionResponse = response.getActionResponse();
        let parsedActions = actionResponse.getAction().trim().split("\n");
        setActionText(parsedActions[0].split(", "));
  }
 },[])
```

Actions have been set up and now you can use the ActionText to perform the required action.


---

# 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.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk-1/actions.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.
