Getting Started
@techwriter/sdk-corev3.2.0STABLEGetting started with the SDK
The TechWriter SDK is a typed, batteries-included client for managing documentation programmatically. It wraps the public REST API with idiomatic helpers in nine languages, retries and pagination handled for you, and a single configuration surface across runtimes.
In production it powers content pipelines that publish thousands of articles a day — but the same library is just as comfortable in a tiny script that exports your knowledge base for backup. This page walks you through installation, configuration, the core domain model, and your first successful request.
Pick your language in the panel on the right. Every code block on this page rerenders for the package manager you choose, so the install command, the client initialization, and the first call always match your stack.
Requirements
The SDK supports nine runtimes. Older versions may work but are not officially tested.
18.0ES modules and CommonJS both supported. Bundled TypeScript types.3.9Sync and async clients ship in the same package.3.0Frozen-string-literal compatible. Thread-safe by default.8.1PSR-7 / PSR-18 HTTP client adapters supported.11Reactor and CompletableFuture variants available.1.21Context-aware. No external dependencies beyond the standard library.6.0Targets net6.0 and net8.0. NuGet package signed.Quickstart
Five steps from a clean checkout to your first authenticated call.
Client configuration
Every option below is named consistently across languages. Optional values fall back to safe production defaults.
apiKeystringrequiredWorkspace API key from Settings → Integrations. Always read this from an environment variable.regionstringoptionalData residency region: us-east-1, eu-central-1, or ap-southeast-2. Defaults to us-east-1.baseURLstringoptionalOverride the API host. Useful for self-hosted deployments and integration tests.timeoutnumberoptionalPer-request timeout in milliseconds. Default: 30,000.retriesnumberoptionalHow many times to retry transient errors (5xx, 429, network) with exponential backoff. Default 3.loggerfunctionoptionalPlug in a structured logger to capture request IDs, latency, and retry counts.fetchfunctionoptionalInject a custom fetch implementation for proxies, mocking, or edge runtimes.Core concepts
A short tour of the domain model. Every SDK call maps onto one of these resources.
What ships in the box
You don't have to glue these features together yourself — they're built into every language binding.
Where to go next
1. Install
npm install @techwriter/sdk-core2. Initialize the client
import { TechWriterClient } from ;
const client = new TechWriterClient({
apiKey: process.env.TECHWRITER_API_KEY,
region: , "color: ">#8b949e">// Choose your data residency
timeout: 5000, "color: ">#8b949e">// Request timeout in milliseconds
retries: 3 "color: ">#8b949e">// Auto-retry transient failures
});3. Make your first call
"color: ">#8b949e">// List the first page of projects in your workspace
async function listProjects() {
try {
const page = await client.projects.list({ top: 20 });
console.log(`Found ${page.totalCount} projects.`);
page.items.forEach((p) =>
console.log(`- ${p.name} (${p.id})`)
);
} catch (err) {
console.error(, err.code, err.message);
}
}
listProjects();Pro tip
Read your API key from an environment variable and load it once at startup. Hard-coding the key — even in dev — is the most common cause of accidental exposure on public repos.