> 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/advanced-topics/custom-providers.md).

# Credentials, identity, and storage

The Convai Unity SDK ships with production-ready defaults for credentials, end-user identity, and session persistence. Each system is backed by a well-defined interface you can implement and register when the defaults do not fit your deployment.

### When to use custom providers

* **CI / secrets management** — API key must not be stored in `ConvaiSettings.asset`; it comes from an environment variable or a secrets vault.
* **Auth-backed identity** — your application has its own user system (OAuth, Steam, custom LMS), and you want Convai's long-term memory and MAU (Monthly Active User) tracking tied to your user IDs.
* **Cloud save or custom storage** — session data must persist to a cloud backend, encrypted storage, or a non-`PlayerPrefs` store.

All three providers are registered by subclassing `ConvaiManager` and overriding `CreateRuntimeBuilder()`. This means you create a new C# class that inherits from `ConvaiManager`, add it as a component to the same GameObject where `ConvaiManager` currently sits, and remove the original. The exception: identity and metadata providers can also be set via direct setters on `ConvaiManager`, which requires no subclassing and is simpler when you do not need to change any other settings.

### Next steps

{% content-ref url="/pages/31f40f584b5fb6b136f239a3d28d2ec74eb938e7" %}
[Custom credential provider](/api-docs/plugins-and-integrations/convai-unity-sdk/advanced-topics/custom-providers/custom-credential-provider.md)
{% endcontent-ref %}

{% content-ref url="/pages/ab23b641f90fca90f9440603f9ec5293143b86e4" %}
[Custom identity provider](/api-docs/plugins-and-integrations/convai-unity-sdk/advanced-topics/custom-providers/custom-identity-provider.md)
{% endcontent-ref %}

{% content-ref url="/pages/ed2429f37bbe856909dff42ad46c8c9e20800e6c" %}
[Custom persistence provider](/api-docs/plugins-and-integrations/convai-unity-sdk/advanced-topics/custom-providers/custom-persistence-provider.md)
{% endcontent-ref %}

{% content-ref url="/pages/a3f7030703670bbb62edbb00ba2ab32fd0f7c82a" %}
[Personal access token](/api-docs/plugins-and-integrations/convai-unity-sdk/advanced-topics/custom-providers/personal-access-token.md)
{% endcontent-ref %}

<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>Custom credential provider</strong><br>Supply API credentials from environment variables, a secrets vault, or any runtime source instead of ConvaiSettings.</td><td><a href="/pages/31f40f584b5fb6b136f239a3d28d2ec74eb938e7">/pages/31f40f584b5fb6b136f239a3d28d2ec74eb938e7</a></td></tr><tr><td><strong>Custom identity provider</strong><br>Tie Convai's end-user identity to your own auth system for stable per-user memory and accurate Monthly Active User (MAU) tracking.</td><td><a href="/pages/ab23b641f90fca90f9440603f9ec5293143b86e4">/pages/ab23b641f90fca90f9440603f9ec5293143b86e4</a></td></tr><tr><td><strong>Custom persistence provider</strong><br>Replace PlayerPrefs session storage with a cloud backend, encrypted file store, or any key-value implementation.</td><td><a href="/pages/ed2429f37bbe856909dff42ad46c8c9e20800e6c">/pages/ed2429f37bbe856909dff42ad46c8c9e20800e6c</a></td></tr><tr><td><strong>Personal access token</strong><br>Generate short-lived tokens from your API key so the real key never ships inside your Unity build.</td><td><a href="/pages/a3f7030703670bbb62edbb00ba2ab32fd0f7c82a">/pages/a3f7030703670bbb62edbb00ba2ab32fd0f7c82a</a></td></tr></tbody></table>


---

# 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/advanced-topics/custom-providers.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.
