@azure/communication-common package

Classes

AzureCommunicationTokenCredential

The CommunicationTokenCredential implementation with support for proactive token refresh.

Interfaces

CommunicationGetTokenOptions

Options for CommunicationTokenCredential's getToken function.

CommunicationTokenCredential

The Azure Communication Services token credential.

CommunicationTokenRefreshOptions

Options for auto-refreshing a Communication Token credential.

CommunicationUserIdentifier

An Azure Communication user.

CommunicationUserKind

IdentifierKind for a CommunicationUserIdentifier.

MicrosoftTeamsAppIdentifier

A Microsoft Teams App.

MicrosoftTeamsAppKind

IdentifierKind for a MicrosoftTeamsAppIdentifier.

MicrosoftTeamsUserIdentifier

A Microsoft Teams user.

MicrosoftTeamsUserKind

IdentifierKind for a MicrosoftTeamsUserIdentifier.

PhoneNumberIdentifier

A phone number.

PhoneNumberKind

IdentifierKind for a PhoneNumberIdentifier.

UnknownIdentifier

An unknown identifier that doesn't fit any of the other identifier types.

UnknownIdentifierKind

IdentifierKind for UnknownIdentifier.

Type Aliases

CommunicationIdentifier

Identifies a communication participant.

CommunicationIdentifierKind

The CommunicationIdentifierKind is a discriminated union that adds a property kind to an Identifier.

Functions

createIdentifierFromRawId(string)

Creates a CommunicationIdentifierKind from a given rawId. When storing rawIds use this function to restore the identifier that was encoded in the rawId.

getIdentifierKind(CommunicationIdentifier)

Returns the CommunicationIdentifierKind for a given CommunicationIdentifier. Returns undefined if the kind couldn't be inferred.

getIdentifierRawId(CommunicationIdentifier)

Returns the rawId for a given CommunicationIdentifier. You can use the rawId for encoding the identifier and then use it as a key in a database.

isCommunicationUserIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements CommunicationUserIdentifier.

isKeyCredential(unknown)

Checks whether a value is a KeyCredential.

isMicrosoftTeamsAppIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements MicrosoftTeamsAppIdentifier.

isMicrosoftTeamsUserIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements MicrosoftTeamsUserIdentifier.

isPhoneNumberIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements PhoneNumberIdentifier.

isUnknownIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements UnknownIdentifier.

Function Details

createIdentifierFromRawId(string)

Creates a CommunicationIdentifierKind from a given rawId. When storing rawIds use this function to restore the identifier that was encoded in the rawId.

function createIdentifierFromRawId(rawId: string): CommunicationIdentifierKind

Parameters

rawId

string

The rawId to be translated to its identifier representation.

Returns

getIdentifierKind(CommunicationIdentifier)

Returns the CommunicationIdentifierKind for a given CommunicationIdentifier. Returns undefined if the kind couldn't be inferred.

function getIdentifierKind(identifier: CommunicationIdentifier): CommunicationIdentifierKind

Parameters

identifier
CommunicationIdentifier

The identifier whose kind is to be inferred.

Returns

getIdentifierRawId(CommunicationIdentifier)

Returns the rawId for a given CommunicationIdentifier. You can use the rawId for encoding the identifier and then use it as a key in a database.

function getIdentifierRawId(identifier: CommunicationIdentifier): string

Parameters

identifier
CommunicationIdentifier

The identifier to be translated to its rawId.

Returns

string

isCommunicationUserIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements CommunicationUserIdentifier.

function isCommunicationUserIdentifier(identifier: CommunicationIdentifier): identifier

Parameters

identifier
CommunicationIdentifier

The assumed CommunicationUserIdentifier to be tested.

Returns

identifier

isKeyCredential(unknown)

Checks whether a value is a KeyCredential.

function isKeyCredential(credential: unknown): credential

Parameters

credential

unknown

The credential being checked.

Returns

credential

isMicrosoftTeamsAppIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements MicrosoftTeamsAppIdentifier.

function isMicrosoftTeamsAppIdentifier(identifier: CommunicationIdentifier): identifier

Parameters

identifier
CommunicationIdentifier

The assumed available to be tested.

Returns

identifier

isMicrosoftTeamsUserIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements MicrosoftTeamsUserIdentifier.

function isMicrosoftTeamsUserIdentifier(identifier: CommunicationIdentifier): identifier

Parameters

identifier
CommunicationIdentifier

The assumed available to be tested.

Returns

identifier

isPhoneNumberIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements PhoneNumberIdentifier.

function isPhoneNumberIdentifier(identifier: CommunicationIdentifier): identifier

Parameters

identifier
CommunicationIdentifier

The assumed PhoneNumberIdentifier to be tested.

Returns

identifier

isUnknownIdentifier(CommunicationIdentifier)

Tests an Identifier to determine whether it implements UnknownIdentifier.

function isUnknownIdentifier(identifier: CommunicationIdentifier): identifier

Parameters

identifier
CommunicationIdentifier

The assumed UnknownIdentifier to be tested.

Returns

identifier