Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebPubSubServiceClient

Package version

Client for connecting to a Web PubSub hub

Hierarchy

  • WebPubSubServiceClient

Index

Constructors

constructor

  • 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');

    Parameters

    • connectionString: string

      The connection string

    • hubName: string

      The name of the hub to connect to. If omitted, '_default' is used.

    • Optional options: HubAdminClientOptions

      Options to configure the http pipeline

    Returns WebPubSubServiceClient

  • 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');

    Parameters

    • endpoint: string

      The endpoint to connect to

    • credential: AzureKeyCredential

      An AzureKeyCredential holding your service key

    • hubName: string

      The name of the hub to connect to. If omitted, '_default' is used.

    • Optional options: HubAdminClientOptions

      Options to configure the http pipeline

    Returns WebPubSubServiceClient

Properties

apiVersion

apiVersion: string = "2020-10-01"

The Web PubSub API version being used by this client

endpoint

endpoint: string

The Web PubSub endpoint this client is connected to

hubName

hubName: string

The name of the hub this client is connected to

Methods

closeConnection

getAuthenticationToken

grantPermission

group

hasConnection

hasGroup

hasPermission

hasUser

removeUserFromAllGroups

revokePermission

sendToAll

sendToConnection

sendToUser

Generated using TypeDoc