@ductape/sdk

中文文档
0.5.10发布于 2026/11/05ISCTypeScriptESM + CJS近 30 天下载 3484

sdk for building ductaped products

原始使用文档
文档目录11 节
  1. Install
  2. Quick start
  3. Examples
  4. Sessions
  5. Message brokers
  6. Storage
  7. Databases
  8. Features
  9. What's available
  10. Requirements
  11. Documentation

@ductape/sdk

Connect your Node.js app to databases, message brokers, storage, sessions, scheduled jobs, and more — all through a single access key.

Install

npm install @ductape/sdk@latest

Quick start

import Ductape from '@ductape/sdk';

const ductape = new Ductape({
  accessKey: 'your-access-key',
  product: 'my-product',
  env: 'prd',
});

Pass product and env once at init; every service call inherits them automatically.

Examples

Sessions

const session = await ductape.sessions.start({
  tag: 'user-session',
  data: { userId: 'u1', email: '[email protected]' },
});
// session.token, session.refreshToken, session.sessionId

await ductape.sessions.verify({ token: session.token });
await ductape.sessions.revoke({ token: session.token });

Message brokers

await ductape.events.produce({
  event: 'order-events:order-created',
  message: { orderId: '123', amount: 99.99 },
});

await ductape.events.consume({
  event: 'order-events:order-created',
  callback: async (msg) => console.log(msg),
});

Supports Kafka, RabbitMQ, Redis, SQS, Google Pub/Sub, and NATS.

Storage

await ductape.storage.upload({
  storage: 'main-storage',
  fileName: 'reports/q1.pdf',
  buffer: fileBuffer,
  mimeType: 'application/pdf',
});

const file = await ductape.storage.download({ storage: 'main-storage', fileName: 'reports/q1.pdf' });
const url  = await ductape.storage.getSignedUrl({ storage: 'main-storage', fileName: 'reports/q1.pdf' });

Supports AWS S3, Google Cloud Storage, and Azure Blob Storage.

Databases

const rows = await ductape.databases.query({
  database: 'main-db',
  table: 'orders',
  where: { status: 'pending' },
});

Supports PostgreSQL, MySQL, MariaDB, and Cassandra.

Features

await ductape.feature.execute({
  tag: 'process-order',
  data: { orderId: '123' },
});

What's available

NamespaceDescription
ductape.sessionsJWT sessions — start, verify, refresh, revoke
ductape.eventsMessage brokers — produce, consume, manage topics
ductape.storageFile storage — upload, download, delete, signed URLs
ductape.databasesRelational databases — query, migrate
ductape.graphGraph database — queries and transactions (Neo4j)
ductape.vectorVector search — upsert and query (Pinecone, Qdrant, Weaviate)
ductape.warehouseUnified query across relational, graph, and vector
ductape.cachesCache — get, set, invalidate
ductape.featureFeatures — execute multi-step product flows
ductape.agentsLLM agents with tools and memory
ductape.modelsLLM inference (OpenAI, Anthropic, and others)
ductape.jobsBackground jobs — schedule and run
ductape.notificationsEmail, SMS, push, and callback notifications
ductape.secretsSecrets — store and resolve per environment
ductape.quotaRate limiting and quota enforcement
ductape.fallbackFallback policies
ductape.healthHealthcheck definitions and status
ductape.cloudCloud connection management
ductape.apiCall actions on integrated third-party apps

Requirements

Node.js 18+. Server-side only — browser environments are not supported.

Documentation

docs.ductape.app

版本与发布记录

@ductape/sdk 共发布 332 个版本,首次发布于 2025/04/20;过去 12 个月发布了 281 个版本。

版本发布日期距今
0.5.10latest2026/11/058 天前
0.5.92026/11/058 天前
0.5.82026/11/058 天前
0.5.72026/11/049 天前
0.5.62026/11/049 天前
0.5.52026/11/0211 天前

其他发布通道:beta → 0.0.4-v21。

关于 @ductape/sdk 的常见问题

@ductape/sdk 是什么?

sdk for building ductaped products

如何安装 @ductape/sdk?

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

@ductape/sdk 支持 TypeScript 吗?

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

@ductape/sdk 支持 ESM 还是 CommonJS?

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

@ductape/sdk 可以商用吗?

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

@ductape/sdk 的下载量有多少?

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

@ductape/sdk 还在维护吗?

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