SDK & Client Libraries

No SDK is required — any HTTP client works. For convenience, Wriven ships optional, isomorphic packages: a typed delivery client, a React rich-text renderer, and Next.js webhook helpers.

The packages

ParamTypeDescription
@wriven-ai/clientcorecreateClient, getEntry, getEntries. Typed, zero-dependency, runs in Node, browsers, and edge.
@wriven-ai/reactreact<WrivenRichText> renderer for richtext fields, with per-node component overrides.
@wriven-ai/nextnextcreateWebhookRoute (verify + revalidate) and verifyWrivenSignature for Next.js.
// VERSION 0.1.0 — ON NPMAll three packages are published on npm (currently 0.1.0). They are optional — the Delivery API is plain HTTP, so a raw fetch works too — but the SDK adds typed responses, automatic retries on 5xx, a request timeout, and a typed WrivenError.

Install

bash
npm install @wriven-ai/client
# optional:
npm install @wriven-ai/react   # richtext renderer (React peer)
npm install @wriven-ai/next    # webhook + signature helpers (Next peer)

Usage

Create a client with your project id and a delivery token, then read entries:

ts
import { createClient } from '@wriven-ai/client';

const wriven = createClient({
  projectId: process.env.WRIVEN_PROJECT_ID,
  token: process.env.WRIVEN_TOKEN,        // wrk_live_… (published) or wrk_preview_… (drafts)
  // baseUrl: 'https://api.wriven.com',   // default
  // retries: 2, timeoutMs: 10000,
});

// list
const { items, total } = await wriven.getEntries('blog_post', {
  sort: '-publishedAt', limit: 10,
});

// one by slug
const post = await wriven.getEntry('blog_post', 'hello-world', { include: 1 });

A preview token (wrk_preview_…) automatically returns drafts, so the same client powers both production and preview. Failed requests throw a typed WrivenError with status and code matching the response envelope.

Other frameworks

Because the core client uses only the global fetch, it runs anywhere — Astro, Vite, Remix, mobile, servers, edge workers. Render richtext fields with <WrivenRichText> in any React app; in non-React stacks, walk the ProseMirror JSON directly as shown in the Rich Text guide. See the Next.js guide for the full SSR + webhook loop.

Next.js Guide