<!-- AvatarFactory Docs · https://avatarfactory.in/docs/sdk/react/greeting-ringback · Full map: https://avatarfactory.in/llms.txt -->

# Greeting & ringback

The line the avatar opens with, and the tone that plays while the call connects.

Two small touches that make a call feel like a call. Both are **off until you turn
them on**, and both work with nothing but `enabled: true`.

```tsx
const config = {
  getSessionToken: async () => fetchSessionToken(),
  mode: "call",
  connectTone: { enabled: true },
  avatar: {
    avatarId: "default",
    greeting: { enabled: true },
  },
};
```

## Greeting

The line the avatar speaks once the session goes live. Turn it on and leave
`message` out to get a built-in line in the chosen `language`, or set your own.

```tsx
avatar: {
  avatarId: "default",
  greeting: { enabled: true, message: "Hey! What can I help with?" },
}
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `avatar.greeting.enabled` **(required)** | `boolean` | — | Speak an opening line. Nothing below applies until this is true. |
| `avatar.greeting.message` | `string` | — | Your own opening line. Omit it and the avatar speaks a built-in greeting in the chosen language. Capped at 400 characters. |
| `avatar.greeting.language` | `GreetingLanguage` | `"en"` | Language of the built-in greeting: en, es, fr, de, hi, ru, pt, ja, or it. Ignored when you supply your own message. |

## Ringback

The tone that plays while the session connects — the waiting-for-pickup sound.
`enabled: true` on its own plays the built-in tone; pass `src` for your own file.
It stops on its own once the call is live.

```tsx
connectTone: { enabled: true, src: "https://cdn.example.com/ring.mp3", volume: 0.8 }
```

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `connectTone.enabled` **(required)** | `boolean` | — | Play a ringback while connecting. Nothing below applies until this is true. |
| `connectTone.src` | `string` | — | URL or data URI for your own tone. Omit it for the built-in one. |
| `connectTone.loop` | `boolean` | `true` | Repeat the tone until the connection completes. |
| `connectTone.volume` | `number` | `0.4` | 0 to 1. A ringback sits under the conversation, not over it. |
| `connectTone.fadeOutMs` | `number` | `350` | Fade-out when it stops. A hard cut clicks. |

> If you pass a `src`, use an **absolute URL that allows cross-origin reads**. The
>   SDK fetches and decodes a custom tone through the Web Audio API, so a path on
>   your own origin will play in local development and then fail silently once the
>   file is served from somewhere else.

> On [React Native](/docs/sdk/react-native/greeting-ringback), `src` is ignored —
>   mobile has no decoder for it and always plays the built-in tone.
