Server SDKs
Server SDKs wrap the REST API for your backend: tokens, rooms, participants, moderation, recording and webhook checks. Each one takes the API URL and your project's API key. You can also call the REST API directly from any language.
| Language | Package |
|---|---|
| Node 18+ | @appsocom/node |
| Python 3.9+ | appsocom |
| PHP 8.1+ | appsocom/appsocom |
| Dart 3 (servers) | appsocom |
| Go | github.com/appsotechltd/appsotech-sfu/go/sfukit |
Keep the key in an environment variable or your platform's secret store, never in code or in your app.
Node
import { SfuKit } from "@appsocom/node";
const kit = new SfuKit({ url: "https://api.appsocom.dev", adminKey: process.env.APPSOCOM_API_KEY! });
const { token } = await kit.createToken({ roomId: "class-1", userId: "u_7", name: "Ada", role: "student" });Python
import os
from appsocom import SfuKit, SfuKitError
kit = SfuKit("https://api.appsocom.dev", os.environ["APPSOCOM_API_KEY"])
tok = kit.create_token("class-1", "u_7", name="Ada", role="student")
tok["token"]
kit.set_role("class-1", "u_9", "student")
kit.mute("class-1", "*", ["mic"], lock=True)Errors raise SfuKitError with .status and .body.
PHP
use SfuKit\SfuKit;
$kit = new SfuKit('https://api.appsocom.dev', getenv('APPSOCOM_API_KEY'));
$tok = $kit->createToken('class-1', 'u_7', ['name' => 'Ada', 'role' => 'student']);
$tok['token'];Dart
import 'package:appsocom/appsocom.dart';
final kit = SfuKit(url: 'https://api.appsocom.dev', adminKey: env['APPSOCOM_API_KEY']!);
final tok = await kit.createToken('class-1', 'u_7', name: 'Ada', role: 'student');Go
import "github.com/appsotechltd/appsotech-sfu/go/sfukit"
kit := sfukit.NewClient("https://api.appsocom.dev", os.Getenv("APPSOCOM_API_KEY"))
tok, err := kit.CreateToken(ctx, sfukit.TokenRequest{RoomID: "class-1", UserID: "u_7", Name: "Ada", Role: "student"})What every SDK covers
Tokens, room info and settings (lock, metadata), participants (role, permissions, metadata, track permissions, remove, ban), mute, admit, chat, hands, attendance, breakouts and webhook signature checks. The Node SDK also covers recording. The Go SDK also covers recording, live streams in and out, polls, captions, summaries and usage. For anything else, the Node, Python, PHP and Dart SDKs have a generic request(method, path, body), or you can call the REST API directly.
Tokens from Appsocom Live are always minted through the API (
POST /tokens). The SDKs' offline token signing needs a deployment secret, which is only for self-hosted servers.