Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.
Example usage:
import { WebPubSubServiceClient } from "@azure/web-pubsub";
const connectionString = process.env['WEB_PUBSUB_CONNECTION_STRING'];
const client = new WebPubSubServiceClient(connectionString, 'chat');
The connection string
The name of the hub to connect to. If omitted, '_default' is used.
Options to configure the http pipeline
Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.
Example usage:
import { WebPubSubServiceClient, AzureKeyCredential } from "@azure/web-pubsub";
const cred = new AzureKeyCredential("<your web pubsub api key>");
const endpoint = "https://xxxx.webpubsubdev.azure.com"
const client = new WebPubSubServiceClient(endpoint, cred, 'chat');
The endpoint to connect to
An AzureKeyCredential holding your service key
The name of the hub to connect to. If omitted, '_default' is used.
Options to configure the http pipeline
The Web PubSub API version being used by this client
The Web PubSub endpoint this client is connected to
The name of the hub this client is connected to
Close a specific connection to this hub
Connection id to close
Additional options
Auth the client connection with userId and custom claims if any
The options that the client has
Grant permissions to a connection
The connection id to grant permissions to
Additional options
Get a client for a group
The name of the group to connect to.
Check if a specific connection is connected to this hub
Connection id to check
Additional options
Check if a particular group exists (i.e. has active connections).
The group name to check for
Additional options
Check if the connection has the specified permission
The connection id to check permission
Additional options
Check if a particular user is connected to this hub.
The user name to check for
Additional options
Remove a specific user from all groups they are joined to
The user id to remove from all groups
Additional options
Revoke permissions from a connection
The connection id to revoke permissions from
Additional options
Broadcast a text message to all connections on this hub.
The text message to send
Additional options
Broadcast a JSON message to all connections on this hub.
The JSON message to send
Additional options
Broadcast a binary message to all connections on this hub.
The message to send
Additional options
Send a text message to a specific connection
Connection id to send to
The text message
Additional options
Send a binary message to a specific connection
Connection id to send to
The JSON message
Additional options
Send a binary message to a specific connection
Connection id to send to
The binary message
Additional options
Send a text message to a specific user
User name to send to
The text message to send
Additional options
Send a JSON message to a specific user
User name to send to
The josn message to send
Additional options
Send a binary message to a specific user
The user name to send to
The binary message to send
Additional options
Generated using TypeDoc
Client for connecting to a Web PubSub hub