Server SDKs
Node, Java, Go, Python, .NET and PHP server SDKs: structure, install, token and REST helpers.
The server SDK solves three things: issuing tokens, calling REST and verifying callback signatures. Node / Java / Go / Python / .NET / PHP provide the same semantics.
Three layers
| Layer | Contents | Documentation |
|---|---|---|
| Token | AccessToken2 / RtcTokenBuilder / RtmTokenBuilder: issue and verify channel tokens | AccessToken2 semantics |
| REST client | Agora-shaped endpoint wrappers (channel queries, bans, recording, streaming, Analytics) | REST API reference |
| Callbacks | Agora-Signature (SHA1) / Agora-Signature-V2 (SHA256) verification and envelope parsing | Callback integration |
Installation
| Language | Package / how to include |
|---|---|
| Node.js / TypeScript | @nimeet/server-sdk |
| Java | Add the Java server SDK dependency to your pom.xml |
| Go | Go module nimeet |
| Python | pip install . (no runtime dependencies) |
| .NET / C# | NiMeet.ServerSdk.csproj |
| PHP | composer require nimeet/server-sdk |
Issue a token in three lines (Node)
import { NiMeetClient, RtcTokenBuilder2 } from '@nimeet/server-sdk';
const token = RtcTokenBuilder2.buildTokenWithUid(appId, appCertificate, 'weekly-sync', 10001, 'host', 3600, 3600);
const channels = await new NiMeetClient({ baseUrl, customerId, customerSecret }).api.getChannelByAppid(appId, 0, 100);The parameter order is identical in every language: appId, appCertificate, channel, uid, role, tokenTtlSeconds, privilegeTtlSeconds. For token semantics (privilege bits, exp/pexp, wildcards) see AccessToken2 semantics.
When to use the SDK and when to call HTTP directly
| Scenario | Recommendation |
|---|---|
| You have a backend and need to issue tokens | Use the SDK (no need to re-implement signing) |
| Bulk channel queries / moderation | Use the SDK's typed wrappers |
| Dependency-injection framework, fine-grained timeout/retry control | HTTP directly with your own client |
| Edge functions (size-sensitive) | HTTP directly (the SDK type surface is larger) |
Callback verification (same shape in every language)
import { verifyCallbackSignature } from '@nimeet/server-sdk';
// Use the raw request-body bytes; do not deserialise first
const ok = verifyCallbackSignature({
rawBody,
signature: headers['agora-signature'],
signatureV2: headers['agora-signature-v2'],
secret: process.env.WEBHOOK_SECRET!,
});For event codes and payloads see Callback event reference; for retries and reconciliation see Callback integration.
FAQ
| Symptom | Cause | Fix |
|---|---|---|
401 invalid_credentials | customerSecret is the pre-rotation value | Get the current secret from the console and update the environment variable |
| Generated token fails verification | The appCertificate belongs to another project | One project has one set of credentials; do not reuse them across projects |
| Callback signature never matches | You re-serialised the deserialised JSON | Use the raw body bytes |
| Go module cannot be fetched | The module proxy is unreachable | Point replace at a local directory |
| No PHP runtime available | The environment has no PHP | An environment limitation, not an SDK problem |