> 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/convai-unity-sdk/scripting-reference.md).

# Scripting reference

The Convai Unity SDK exposes two complementary approaches for C# integration. `ConvaiSessionEventRelay`, `ConvaiCharacterEventRelay`, and `ConvaiTranscriptEventRelay` are MonoBehaviours that wire events directly in the Inspector — no code required. For scripted reactions and programmatic control, the `ConvaiEvents` typed event hub and each component's C# API give full access from any script. Both approaches observe the same underlying SDK events and can be combined freely.

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Session events</strong><br>Connection state, errors, idle warnings, and participant changes via relay component or typed C# hub.</td><td><a href="/pages/13ed97201ea2961909236d907e7a691b7b7def81">/pages/13ed97201ea2961909236d907e7a691b7b7def81</a></td></tr><tr><td><strong>Character events</strong><br>Speech, emotion, transcript, turn lifecycle, and action events via relay component or typed C# hub.</td><td><a href="/pages/3fa7a83ca1955b2d681906cc6ffdc44f9683ef41">/pages/3fa7a83ca1955b2d681906cc6ffdc44f9683ef41</a></td></tr><tr><td><strong>Transcript API</strong><br>Pull-based facade for querying and subscribing to the live in-memory transcript timeline.</td><td><a href="/pages/e501926159d08f9eb11113c38bcb4aee32ea2253">/pages/e501926159d08f9eb11113c38bcb4aee32ea2253</a></td></tr><tr><td><strong>Character &#x26; Player API</strong><br>Full method, property, and event reference for <code>ConvaiCharacter</code> and <code>ConvaiPlayer</code>.</td><td><a href="/pages/zSQGrBgxcfPV6Be5qFA6">/pages/zSQGrBgxcfPV6Be5qFA6</a></td></tr><tr><td><strong>ConvaiManager API</strong><br>SDK entry point — connection control, facade accessors, conversation ownership, and service discovery.</td><td><a href="/pages/bc1b761d6432e6496add7c93a083259799218063">/pages/bc1b761d6432e6496add7c93a083259799218063</a></td></tr><tr><td><strong>Audio API</strong><br>Microphone muting, per-character audio control, audio playback unlock, and listening state.</td><td><a href="/pages/1873379028012da716187c46997839e09a10b6ad">/pages/1873379028012da716187c46997839e09a10b6ad</a></td></tr><tr><td><strong>Operation &#x26; stream types</strong><br>Type reference for <code>IConvaiOperation&#x3C;T></code>, <code>IConvaiStream&#x3C;T></code>, <code>ConvaiError</code>, <code>Unit</code>, and status enums.</td><td><a href="/pages/88530803851e054def9b3a199945d96762d4ac8c">/pages/88530803851e054def9b3a199945d96762d4ac8c</a></td></tr><tr><td><strong>Async patterns</strong><br>Six patterns for consuming SDK async types: async/await, coroutines, chaining, progress, cancellation, and streams.</td><td><a href="/pages/1c63f5b931ba9aeb0d22176097b938c510fb5891">/pages/1c63f5b931ba9aeb0d22176097b938c510fb5891</a></td></tr></tbody></table>

### Next steps

Start with [Session Events](/api-docs/plugins-and-integrations/convai-unity-sdk/scripting-reference/session-events.md) and [Character Events](/api-docs/plugins-and-integrations/convai-unity-sdk/scripting-reference/character-events.md) to wire SDK events to your scene logic, then explore the [ConvaiManager API](/api-docs/plugins-and-integrations/convai-unity-sdk/scripting-reference/convaimanager-api.md) for connection control and the [Async Patterns](/api-docs/plugins-and-integrations/convai-unity-sdk/scripting-reference/async-patterns.md) page for consumption guidance.


---

# 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:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/scripting-reference.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.
