Skip to main content

SDK Reference

Ductape provides server SDKs for TypeScript and NestJS.

Install

npm install @ductape/sdk@0.1.8

Current versions

LanguagePackage / moduleVersion
TypeScript@ductape/sdk0.1.8
NestJS@ductape/nestjs0.1.0 (requires @ductape/sdk ≥ 0.1.12)

Changelog: TypeScript.

Documentation by language

LanguagePackage / moduleRepo docs
TypeScript@ductape/sdkThis site (Backend sections)
NestJS@ductape/nestjsNestJS integration on this site

Runtime defaults (TypeScript)

Set product and env on the Ductape constructor only (not via configure(), env vars, or product.init). Omitted fields on connect() and queries inherit from the constructor or active connection.

const ductape = new Ductape({
accessKey: process.env.DUCTAPE_ACCESS_KEY!,
product: 'my-product',
env: 'dev',
});
await ductape.databases.connect({ database: 'users-db' });
await ductape.api.run({
app: 'stripe',
action: 'create-charge',
input: { amount: 1000, currency: 'usd' },
});

NestJS

For NestJS apps, use @ductape/nestjs — modules, injectable handles, and decorators such as @Api, @Database, @Storage, and @Webhook. See the NestJS integration guide. NestJS examples are TypeScript only (not included in the multi-language SDK tabs above).

npm install @ductape/nestjs @ductape/sdk

Quickstart