JavaScript and TypeScript clients for SignalR for ASP.NET Core and Azure SignalR Service.
Support Uniapp
npm install uniapp-signalr
# or
yarn add uniapp-signalr
See the SignalR Documentation at learn.microsoft.com for documentation on the latest release. API Reference Documentation is also available on learn.microsoft.com.
For documentation on using this client with Azure SignalR Service and Azure Functions, see the SignalR Service serverless developer guide.
import * as signalR from "uniapp-signalr";
let connection = new signalR.HubConnectionBuilder()
.withUrl("/chat")
.build();
connection.on("send", data => {
console.log(data);
});
connection.start()
.then(() => connection.invoke("send", "Hello"));