File tree Expand file tree Collapse file tree 6 files changed +29
-18
lines changed
sdk/communication/communication-chat/samples Expand file tree Collapse file tree 6 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 66 */
77
88const { ChatClient } = require ( "@azure/communication-chat" ) ;
9- const { AzureCommunicationTokenCredential } = require ( "@azure/communication-common" ) ;
9+ const {
10+ AzureCommunicationTokenCredential,
11+ parseConnectionString
12+ } = require ( "@azure/communication-common" ) ;
1013const { CommunicationIdentityClient } = require ( "@azure/communication-identity" ) ;
1114
1215// Load the .env file if it exists
@@ -16,8 +19,7 @@ async function main() {
1619 const connectionString =
1720 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
1821 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
19- const endpoint =
20- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
22+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2123
2224 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2325 const user = await identityClient . createUser ( ) ;
Original file line number Diff line number Diff line change 88const { ChatClient } = require ( "@azure/communication-chat" ) ;
99const {
1010 AzureCommunicationTokenCredential,
11- getIdentifierKind
11+ getIdentifierKind,
12+ parseConnectionString
1213} = require ( "@azure/communication-common" ) ;
1314const { CommunicationIdentityClient } = require ( "@azure/communication-identity" ) ;
1415
@@ -19,8 +20,7 @@ async function main() {
1920 const connectionString =
2021 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
2122 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
22- const endpoint =
23- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
23+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2424
2525 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2626 const user = await identityClient . createUser ( ) ;
Original file line number Diff line number Diff line change 66 */
77
88const { ChatClient } = require ( "@azure/communication-chat" ) ;
9- const { AzureCommunicationTokenCredential } = require ( "@azure/communication-common" ) ;
9+ const {
10+ AzureCommunicationTokenCredential,
11+ parseConnectionString
12+ } = require ( "@azure/communication-common" ) ;
1013const { CommunicationIdentityClient } = require ( "@azure/communication-identity" ) ;
1114
1215// Load the .env file if it exists
@@ -16,8 +19,7 @@ async function main() {
1619 const connectionString =
1720 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
1821 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
19- const endpoint =
20- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
22+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2123
2224 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2325 const user = await identityClient . createUser ( ) ;
Original file line number Diff line number Diff line change 66 */
77
88import { ChatClient } from "@azure/communication-chat" ;
9- import { AzureCommunicationTokenCredential } from "@azure/communication-common" ;
9+ import {
10+ AzureCommunicationTokenCredential ,
11+ parseConnectionString
12+ } from "@azure/communication-common" ;
1013import { CommunicationIdentityClient } from "@azure/communication-identity" ;
1114
1215// Load the .env file if it exists
@@ -17,8 +20,7 @@ export async function main() {
1720 const connectionString =
1821 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
1922 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
20- const endpoint =
21- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
23+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2224
2325 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2426 const user = await identityClient . createUser ( ) ;
Original file line number Diff line number Diff line change 66 */
77
88import { ChatClient } from "@azure/communication-chat" ;
9- import { AzureCommunicationTokenCredential , getIdentifierKind } from "@azure/communication-common" ;
9+ import {
10+ AzureCommunicationTokenCredential ,
11+ getIdentifierKind ,
12+ parseConnectionString
13+ } from "@azure/communication-common" ;
1014import { CommunicationIdentityClient } from "@azure/communication-identity" ;
1115
1216// Load the .env file if it exists
@@ -17,8 +21,7 @@ export async function main() {
1721 const connectionString =
1822 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
1923 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
20- const endpoint =
21- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
24+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2225
2326 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2427 const user = await identityClient . createUser ( ) ;
Original file line number Diff line number Diff line change 66 */
77
88import { ChatClient } from "@azure/communication-chat" ;
9- import { AzureCommunicationTokenCredential } from "@azure/communication-common" ;
9+ import {
10+ AzureCommunicationTokenCredential ,
11+ parseConnectionString
12+ } from "@azure/communication-common" ;
1013import { CommunicationIdentityClient } from "@azure/communication-identity" ;
1114
1215// Load the .env file if it exists
@@ -17,8 +20,7 @@ export async function main() {
1720 const connectionString =
1821 process . env [ "COMMUNICATION_CONNECTION_STRING" ] ||
1922 "endpoint=https://<resource-name>.communication.azure.com/;<access-key>" ;
20- const endpoint =
21- process . env [ "COMMUNICATION_ENDPOINT" ] || "https://<resource-name>.communication.azure.com" ;
23+ const endpoint = parseConnectionString ( connectionString ) . endpoint ;
2224
2325 const identityClient = new CommunicationIdentityClient ( connectionString ) ;
2426 const user = await identityClient . createUser ( ) ;
You can’t perform that action at this time.
0 commit comments