CreateConversationOptionsBuilder class

Fluent builder for CreateConversationOptions.

Example

const opts = CreateConversationOptionsBuilder
  .create('my-client-id', 'msteams')
  .withUser('user-aad-id')
  .withTenantId('tenant-id')
  .build()

Methods

build()

Builds and returns CreateConversationOptions.

create(ConversationClaims, string, string, PartialParameters>)

Creates a new builder from an existing claims object (e.g. from a stored Conversation).

create(string, string, string, PartialParameters>)

Creates a new builder from an agent client ID string.

isGroup(boolean)

Sets parameters.isGroup.

storeConversation(boolean)

Controls whether the resulting conversation is stored after creation.

withActivity(Partial)

Sets parameters.activity. Defaults activity.type to 'message' if not provided.

withChannelData(object)

Merges additional channel-specific data into parameters.channelData.

withScope(string)

Overrides the default AzureBotScope OAuth scope.

withTeamsChannelId(string)

Sets parameters.isGroup = true and channelData.channel.id. Only has effect on msteams channels.

withTenantId(string)

Sets parameters.tenantId. On msteams channels, also sets channelData.tenant.id.

withTopicName(string)

Sets parameters.topicName.

withUser(ChannelAccount)
withUser(string, string)

Adds a member (the target user) to parameters.members.

Method Details

build()

Builds and returns CreateConversationOptions.

function build(): CreateConversationOptions

Returns

create(ConversationClaims, string, string, PartialParameters>)

Creates a new builder from an existing claims object (e.g. from a stored Conversation).

static function create(claims: ConversationClaims, channelId: string, serviceUrl?: string, parameters?: Partial): CreateConversationOptionsBuilder

Parameters

claims
ConversationClaims

JWT claims — aud must be the agent's client ID.

channelId

string

The target channel (e.g. 'msteams').

serviceUrl

string

Optional service URL override.

parameters

Partial<ConversationParameters>

Returns

create(string, string, string, PartialParameters>)

Creates a new builder from an agent client ID string.

static function create(agentClientId: string, channelId: string, serviceUrl?: string, parameters?: Partial): CreateConversationOptionsBuilder

Parameters

agentClientId

string

The agent's client (app) ID.

channelId

string

The target channel (e.g. 'msteams').

serviceUrl

string

Optional service URL override.

parameters

Partial<ConversationParameters>

Returns

isGroup(boolean)

Sets parameters.isGroup.

function isGroup(value: boolean): this

Parameters

value

boolean

Returns

this

storeConversation(boolean)

Controls whether the resulting conversation is stored after creation.

function storeConversation(value: boolean): this

Parameters

value

boolean

Returns

this

withActivity(Partial)

Sets parameters.activity. Defaults activity.type to 'message' if not provided.

function withActivity(activity: Partial): this

Parameters

activity

Partial<Activity>

Returns

this

withChannelData(object)

Merges additional channel-specific data into parameters.channelData.

function withChannelData(data: object): this

Parameters

data

object

Returns

this

withScope(string)

Overrides the default AzureBotScope OAuth scope.

function withScope(scope: string): this

Parameters

scope

string

Returns

this

withTeamsChannelId(string)

Sets parameters.isGroup = true and channelData.channel.id. Only has effect on msteams channels.

function withTeamsChannelId(teamsChannelId: string): this

Parameters

teamsChannelId

string

Returns

this

withTenantId(string)

Sets parameters.tenantId. On msteams channels, also sets channelData.tenant.id.

function withTenantId(tenantId: string): this

Parameters

tenantId

string

Returns

this

withTopicName(string)

Sets parameters.topicName.

function withTopicName(name: string): this

Parameters

name

string

Returns

this

withUser(ChannelAccount)

function withUser(account: ChannelAccount): this

Parameters

account
ChannelAccount

Returns

this

withUser(string, string)

Adds a member (the target user) to parameters.members.

function withUser(userId: string, userName?: string): this

Parameters

userId

string

userName

string

Returns

this