---
url: https://talkjs.com/docs/UI_Components/React_Native/API/getConversationBuilder
---

# getConversationBuilder

Get a builder to create or update a conversation.

Ask a question Copy for LLM [View as Markdown](/docs/UI_Components/React_Native/API/getConversationBuilder.md)
A factory function used to retrieve a [`ConversationBuilder`](/docs/UI_Components/React_Native/Object_Types/ConversationBuilder/) object
based on the `conversationId` given.

The [`ConversationBuilder`](/docs/UI_Components/React_Native/Object_Types/ConversationBuilder/) object encapsulates a conversation
between 2 or more participants. Use the methods, [`setParticipant`](/docs/UI_Components/React_Native/Object_Types/ConversationBuilder/#setparticipant) and [`setAttributes`](/docs/UI_Components/React_Native/Object_Types/ConversationBuilder/#setattributes) on the returned object to
further set up your conversation.

```typescript
getConversationBuilder(conversationId: string): ConversationBuilder
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| **conversationId** Required | `string` | The conversation ID |

## Returns

[`ConversationBuilder`](/docs/UI_Components/React_Native/Object_Types/ConversationBuilder/)

## Example

TypeScript

```typescript
import * as TalkRn from '@talkjs/react-native';

const me: TalkRn.User = {
  id: '123456789',
  name: 'Alice',
  email: 'alice@example.com',
  photoUrl: 'https://talkjs.com/images/avatar-1.jpg',
  welcomeMessage: 'Hey there! How are you? :-)',
};

const other: TalkRn.User = {
  id: '432156789',
  name: 'Sebastian',
  email: 'Sebastian@example.com',
  photoUrl: 'https://talkjs.com/images/avatar-5.jpg',
  welcomeMessage: 'Hey, how can I help? https://google.com',
};

const conversationId = TalkRn.oneOnOneId(me.id, other.id);
const conversationBuilder = TalkRn.getConversationBuilder(conversationId);

conversationBuilder.setParticipant(me);
conversationBuilder.setParticipant(other, { notify: false });

conversationBuilder.setAttributes({ subject: 'Random conversation' });
```