Octri

Languages

TypeScript

The TypeScript SDK publishes to npm and ships with full type definitions generated from your spec.

Install

bash
npm install @your-org/api-client

Options

Set these per language in SDK Studio. A per-language value overrides the project-wide default.

OptionValuesDefault
HTTP enginefetch, axiosfetch
Callbacksomit, includeomit
Client stylefunctions, namespaced, class, class-namespacedfunctions
Argument styleobject, positionalobject
Namespacetags, pathtags
Doc commentsfull, minimalfull
File headeromit, includeomit
Usage examplefull, concisefull

HTTP engine

typescript
// Native fetch — no dependencies
await fetch(url, init);

The default. Zero dependencies, works in Node 18+, browsers, Deno, Bun, and edge runtimes.

Leave it on fetch unless your users ask

fetch keeps the package dependency-free, which matters more to a consumer than it does to you. An SDK that drags axios into a browser bundle is a cost your users pay on every page load.

Callbacks

include emits callback-style variants alongside the promise-based methods. Only worth it for consumers on codebases that predate promises.

Package name

npm is scoped or unscoped:

text
@acme/api        scoped, recommended
acme-api         unscoped

Scoped names are namespaced to your org, so they can't be squatted and read unambiguously.

The first publish claims the name for good

npm does not allow renaming, and refuses to republish a deleted version. Get it right before the first release. See Publishing.

What callers write

typescript
import { AcmeClient } from "@acme/api";

const client = new AcmeClient({ token: process.env.ACME_TOKEN });

for await (const user of client.users.list({ limit: 100 })) {
  console.log(user.id);
}

Types come from the spec, so a renamed field surfaces as a compile error rather than an undefined at runtime.