ENFR0.1.0-rc.3

Code samples and SDKs

Protocol examples are generated. SDK examples are mapped by you.


Code samples and SDKs
0:00 / 0:16

Every operation shows cURL, HTTP, JavaScript, TypeScript, Java and Python examples generated from the canonical operation. Choosing an environment changes only the approved base URL; credentials stay placeholders.

Map an SDK

specistry.config.ts
sdks: [{
  id: "ts",
  label: "TypeScript",
  language: "typescript",
  package: "@testinbox/client",
  examples: [{
    operation: "createInbox",
    code: "const inbox = await client.inboxes.create({ ttl: 3600 });",
  }],
}],

Code in guides

Fenced code is highlighted at build time. title="…" is the only fence attribute.

docs/quickstart.md
```typescript title="signup.test.ts"
const inbox = await client.inboxes.create({ ttl: 600 });
```

Use CodeGroup for the same thing in several tools — each fence title becomes a tab.

docs/install.mdx
<CodeGroup>

```bash title="npm"
npm install @testinbox/client
```

```bash title="pnpm"
pnpm add @testinbox/client
```

</CodeGroup>

Edge cases

Extra fence attributes

CONTENT_COMPONENT_PROP_INVALID
✕ FAILS
docs/x.md
```ts title="a.ts" highlight="2"
✓ FIX
docs/x.md
```ts title="a.ts"

Only `title` is accepted.

Unknown language

No diagnostic
✕ FAILS
docs/x.md
```hcl
✓ FIX
docs/x.md
```toml

It renders as plain text. Use a supported alias if one fits.

No SDK yet

Misleading
✕ FAILS
specistry.config.ts
sdks: [{ id: "ts", examples: [] }]
✓ FIX
specistry.config.ts
// omit sdks entirely

Readers assume a client exists.

Report an issue with this page on GitHub