# Справочник Embed SDK

Функция `mount(options)` добавляет iframe в контейнер страницы и возвращает
экземпляр плеера. Для первого подключения используйте [быстрый старт](/documentation/ru/guides/embed/sdk-quickstart).

## Параметры mount

### AvatarStudioMountOptions

| Prop          | Type                    | Description                                                           |
| ------------- | ----------------------- | --------------------------------------------------------------------- |
| `token`       | `string`                | Published experience slug from the share URL.                         |
| `container`   | `string \| HTMLElement` | DOM element or CSS selector that will contain the iframe.             |
| `platformUrl` | `string`                | Origin of the Avatar Studio deployment that published the experience. |

## Методы плеера

### AvatarStudioEmbed

| Prop              | Type                                                                                                               | Description                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| `registerTool`    | `(method: string, handler: (args: Record<string, unknown>) => unknown \| Promise<unknown>) => () => void`          | Register a client-side tool and return a function that unregisters it.            |
| `on`              | `(event: AvatarStudioEventType, listener: (payload: unknown, message: AvatarStudioMessage) => void) => () => void` | Subscribe to a player event and return an unsubscribe callback.                   |
| `start`           | `() => void`                                                                                                       | Send the legacy start command. Use startListening to connect with the microphone. |
| `configureVisit`  | `(scope: AvatarVisitScope) => void`                                                                                |                                                                                   |
| `setPresentation` | `(intent: AvatarPresentationIntent, requestId: string) => void`                                                    |                                                                                   |
| `endVisit`        | `(scope: AvatarVisitScope, reason: string, requestId: string) => void`                                             |                                                                                   |
| `setViewport`     | `(viewport: AvatarViewport) => void`                                                                               |                                                                                   |
| `startListening`  | `() => void`                                                                                                       | Enable the microphone and connect the session if needed.                          |
| `stopListening`   | `() => void`                                                                                                       | Disable microphone input.                                                         |
| `sendText`        | `(text: string) => void`                                                                                           | Send a text message as the visitor.                                               |
| `interrupt`       | `() => void`                                                                                                       | Interrupt the avatar's current speech.                                            |
| `reset`           | `() => void`                                                                                                       | Reset the conversation for the next visitor.                                      |
| `destroy`         | `() => void`                                                                                                       | Release the iframe and listeners and close the player session.                    |

События плеера и команды хоста перечислены в [протоколе встраивания](/documentation/ru/guides/embed/bridge).
