> 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

{% hint style="info" %}
:no\_entry: This plugin has been deprecated and is no longer supported.

\
If you are still running the old plugin, we recommend switching to the new Convai Web SDK: [Link](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk)

\
For historical reference only — these docs are no longer 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](/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 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://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk-1/actions.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.
