@sama-communications/sdk
v0.16.0
Published
A SDK client for interacting with the SAMA chat server from Web/Node.js apps
Readme
SAMA SDK
A SDK client for interacting with the SAMA chat server from Web/Node.js apps
Demo
This is a demo app to test all these methods https://app.samacloud.io/demo
API documentation
See all available methods api/api.ts
Installation
npm install @sama-communications/sdkUsage
import { SAMAClient } from "@sama-communications/sdk";
const config = {
endpoint: {
ws: "wss://your-websocket-url"
http: "https://your-websocket-url.com"
}
}
const client = new SAMAClient(config);
client
.connect()
.then(() => {
console.log("Connected to the server");
})
.catch((error) => {
console.error("Failed to connect to the server:", error);
});
client
.userLogin({ login: "user_login", password: "user_password" })
.then((response) => {
console.log("User logged in:", response);
})
.catch((error) => {
console.error("Failed to log in:", error);
});
...Have an issue?
Join our Discord for quick answers to your questions or write your question in the issues tab
Community and support
Join our community for support and discussions:
