azure-web-pubsub-ts

Solid

Build real-time messaging applications using Azure Web PubSub SDKs for JavaScript (@azure/web-pubsub, @azure/web-pubsub-client). Use when implementing WebSocket-based real-time features, pub/sub messaging, group chat, or live notifications.

Web & Frontend 2,541 stars 295 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Azure Web PubSub SDKs for TypeScript Real-time messaging with WebSocket connections and pub/sub patterns. ## Installation ```bash # Server-side management npm install @azure/web-pubsub @azure/identity # Client-side real-time messaging npm install @azure/web-pubsub-client # Express middleware for event handlers npm install @azure/web-pubsub-express ``` ## Environment Variables ```bash WEBPUBSUB_CONNECTION_STRING=Endpoint=https://<resource>.webpubsub.azure.com;AccessKey=<key>;Version=1.0; WEBPUBSUB_ENDPOINT=https://<resource>.webpubsub.azure.com ``` ## Server-Side: WebPubSubServiceClient ### Authentication ```typescript import { WebPubSubServiceClient, AzureKeyCredential } from "@azure/web-pubsub"; import { DefaultAzureCredential } from "@azure/identity"; // Connection string const client = new WebPubSubServiceClient( process.env.WEBPUBSUB_CONNECTION_STRING!, "chat" // hub name ); // DefaultAzureCredential (recommended) const client2 = new WebPubSubServiceClient( process.env.WEBPUBSUB_ENDPOINT!, new DefaultAzureCredential(), "chat" ); // AzureKeyCredential const client3 = new WebPubSubServiceClient( process.env.WEBPUBSUB_ENDPOINT!, new AzureKeyCredential("<access-key>"), "chat" ); ``` ### Generate Client Access Token ```typescript // Basic token const token = await client.getClientAccessToken(); console.log(token.url); // wss://...?access_token=... // Token with user ID const userToken = await client.getClientAccessToken({ userId: "user123"...

Details

Author
microsoft
Repository
microsoft/skills
Created
4 months ago
Last Updated
yesterday
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category