Skip to main content

SDK Reference

Ductape provides server SDKs for TypeScript, Java, Go, and .NET. Code examples in this site use tabs for each language where applicable.

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)
Javaapp.ductape:sdk0.1.8
Gogithub.com/ductape/ductape/sdk/gov0.1.8 (git tag sdk/go/v0.1.8)
.NETDuctape.Sdk0.1.8

Changelogs: TypeScript, Java, Go, .NET.

Documentation by language

LanguagePackage / moduleRepo docs
TypeScript@ductape/sdkThis site (Backend sections)
NestJS@ductape/nestjsNestJS integration on this site
Javaapp.ductape:sdksdk/java/README.md, migration
Gogithub.com/ductape/ductape/sdk/gosdk/go/README.md, migration
.NETDuctape.Sdksdk/dotnet/README.md, migration

Readiness

See SDK readiness for production comparison across Java, Go, and .NET.

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