> 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-pixel-streaming-embed/api-reference.md).

# API Reference

## PixelStreamComponent Props (React)

| Prop                          | Type              | Required | Description                                                                  |
| ----------------------------- | ----------------- | -------- | ---------------------------------------------------------------------------- |
| `expId`                       | `string`          | ✅ Yes    | The unique experience ID for the experience you want to load.                |
| `InitialScreen`               | `React.ReactNode` | ❌ No     | Optional custom loading screen component shown before the stream loads.      |
| `serviceUrls`                 | `object`          | ❌ No     | Override default service endpoints (useful for on-premise or custom setups). |
| `serviceUrls.sessionFetch`    | `string`          | ❌ No     | Custom URL for fetching session data.                                        |
| `serviceUrls.pixelStreamBase` | `string`          | ❌ No     | Custom base URL for connecting to the Pixel Streaming server.                |

***

## PixelStreamComponentHandles Methods (React)

These methods are exposed via the `ref` to the component:

| Method                    | Description                                |
| ------------------------- | ------------------------------------------ |
| `enableCamera()`          | Enables the user's webcam.                 |
| `disableCamera()`         | Disables the user's webcam.                |
| `enableCharacterAudio()`  | Unmutes audio coming from the character.   |
| `disableCharacterAudio()` | Mutes the character audio.                 |
| `initializeExperience()`  | Starts the experience if not auto-started. |

***

## PixelStreamClient Options (Vanilla / TS / CDN)

| Option                        | Type          | Required | Description                                                                  |
| ----------------------------- | ------------- | -------- | ---------------------------------------------------------------------------- |
| `container`                   | `HTMLElement` | ✅ Yes    | DOM element where the pixel stream will be mounted.                          |
| `expId`                       | `string`      | ✅ Yes    | The experience ID to load the experience.                                    |
| `InitialScreen`               | `HTMLElement` | ❌ No     | Optional loading screen shown while the experience initializes.              |
| `serviceUrls`                 | `object`      | ❌ No     | Object to override default endpoints (for on-premise or custom backend use). |
| `serviceUrls.sessionFetch`    | `string`      | ❌ No     | Custom endpoint for session fetch API.                                       |
| `serviceUrls.pixelStreamBase` | `string`      | ❌ No     | Base URL of the Pixel Streaming backend server.                              |

***

## PixelStreamClient Methods

These are available on the `pixelStream` instance in Vanilla/TS/CDN setups:

| Method                    | Description                                    |
| ------------------------- | ---------------------------------------------- |
| `enableCamera()`          | Enables the user’s webcam. Returns a Promise.  |
| `disableCamera()`         | Disables the user’s webcam. Returns a Promise. |
| `enableCharacterAudio()`  | Enables character audio output.                |
| `disableCharacterAudio()` | Disables character audio output.               |
| `initializeExperience()`  | Starts the experience manually.                |
| `destroy()`               | Cleans up the stream and DOM elements.         |


---

# 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/convai-pixel-streaming-embed/api-reference.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.
