@dialstack/sdk-server

中文文档
3.10.0发布于 2026/11/10MITTypeScriptESM + CJS零依赖近 30 天下载 4817

Node.js server client for the DialStack SDK — REST API, webhooks and media streams

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. Webhooks
  4. Which package do I want?
  5. Types shared with the browser SDK
  6. Documentation
  7. License

@dialstack/sdk-server

Node.js server client for the DialStack SDK — the REST API, webhook signature verification and media streams.

Never import this from browser code. It reads your secret key.

  • No runtime dependencies. One package, nothing transitive. CI fails the build if that stops being true.
  • No browser code. None of the web components, React bindings or the softphone are reachable from here, so a backend deployment does not carry them.

Install

npm install @dialstack/sdk-server

Usage

import { DialStack } from '@dialstack/sdk-server';

const dialstack = new DialStack(process.env.DIALSTACK_SECRET_KEY);
const calls = await dialstack.calls.list({ limit: 20 });

// Every list method auto-paginates: await it for the first page envelope, or
// iterate to walk the whole collection.
for await (const call of dialstack.calls.list().autoPagingEach()) {
  console.log(call.id);
}

Webhooks

webhooks is a static, so verification needs no client instance and no secret key:

import { DialStack } from '@dialstack/sdk-server';

const event = DialStack.webhooks.constructEvent(
  rawBody, // string | Buffer
  req.headers['x-dialstack-signature'],
  process.env.DIALSTACK_WEBHOOK_SECRET
);

Pass the raw body. A framework that parses JSON before you see it re-serializes with different bytes, and the signature will not match. It throws on a bad signature or a timestamp outside the tolerance window (300s by default).

Which package do I want?

You are buildingInstall
A Node backendthis package alone
A plain HTML page@dialstack/sdk-js
A React app with DialStack UI@dialstack/sdk-js + @dialstack/sdk-react
A softphone in any framework@dialstack/sdk-webrtc

Types shared with the browser SDK

Some request and response shapes — button templates, device settings — are the same wire contract the browser SDK describes, so they are defined once in @dialstack/sdk-js and named here in import type only. The declaration build inlines their definitions into this package's own .d.ts, so they resolve for you without installing anything else. That is why @dialstack/sdk-js appears in devDependencies and not in dependencies.

Documentation

Full documentation: https://docs.dialstack.ai/sdks

License

MIT

版本与发布记录

@dialstack/sdk-server 共发布 12 个版本,首次发布于 2026/08/10;过去 12 个月发布了 12 个版本。

版本发布日期距今
3.10.0latest2026/11/102 天前
3.9.02026/11/029 天前
3.8.02026/10/2616 天前
3.7.02026/10/1923 天前
3.6.02026/10/1230 天前
3.5.02026/10/051 个月前

其他发布通道:bootstrap → 2.1.0。

关于 @dialstack/sdk-server 的常见问题

@dialstack/sdk-server 是什么?

Node.js server client for the DialStack SDK — REST API, webhooks and media streams

如何安装 @dialstack/sdk-server?

在项目目录运行 npm install @dialstack/sdk-server,或使用 pnpm add / yarn add / bun add。

@dialstack/sdk-server 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dialstack/sdk-server 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@dialstack/sdk-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dialstack/sdk-server 可以商用吗?

@dialstack/sdk-server 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dialstack/sdk-server 的下载量有多少?

根据 npm 官方下载统计,@dialstack/sdk-server 在 2026/10/12 – 2026/11/10 这 30 天内被下载 4,817 次,日均约 161 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dialstack/sdk-server 还在维护吗?

最新版本 3.10.0 发布于 2026/11/10(2 天前);至今共发布 12 个版本,其中过去 12 个月发布了 12 个;首次发布于 2026/08/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。