@azure/communication-network-traversal v1.1.0-beta.1
Azure Communication Network Traversal client library for JavaScript
Azure Communication Network Traversal is managing tokens for Azure Communication Services.
It will provide TURN credentials to a user.
Getting started
Prerequisites
- An Azure subscription.
- An existing Communication Services resource. If you need to create the resource, you can use the Azure Portal, theAzure PowerShell, or the Azure CLI.
Installing
npm install @azure/communication-network-traversal
npm install @azure/communication-identity
Browser support
JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our bundling documentation.
Key concepts
Examples
Authentication
You can get a key and/or connection string from your Communication Services resource in Azure Portal. Once you have a key, you can authenticate the CommunicationRelayClient
with any of the following methods:
Create KeyCredential
with AzureKeyCredential
before initializing the client
import { AzureKeyCredential } from "@azure/core-auth";
import { CommunicationRelayClient } from "@azure/communication-network-traversal";
const credential = new AzureKeyCredential(KEY);
const client = new CommunicationRelayClient(ENDPOINT, credential);
Using a connection string
import { CommunicationRelayClient } from "@azure/communication-network-traversal";
const connectionString = `endpoint=ENDPOINT;accessKey=KEY`;
const client = new CommunicationRelayClient(connectionString);
Using a TokenCredential
import { DefaultAzureCredential } from "@azure/identity";
import { CommunicationRelayClient } from "@azure/communication-network-traversal";
const credential = new DefaultAzureCredential();
const client = new CommunicationRelayClient(ENDPOINT, credential);
If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in Azure Portal.
Usage
Creating an instance of CommunicationRelayClient
import { CommunicationRelayClient } from "@azure/communication-network-traversal";
const client = new CommunicationRelayClient(CONNECTION_STRING);
Creating an instance of CommunicationIdentityClient to create a user
import { CommunicationIdentityClient } from "@azure/communication-identity";
const client = new CommunicationIdentityClient(CONNECTION_STRING);
Use the createUser
method to create a new user.
const user = await client.createUser();
Getting the configurationRelay
Use the getConfigurationRelay
method to get new TURN credentials
const config = relayClient.getRelayConfiguration(user);
Troubleshooting
Next steps
Contributing
If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.
Related projects
2 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
8 months ago
7 months ago
10 months ago
9 months ago
10 months ago
10 months ago
8 months ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago