Docs/Quickstart

Actionpackd AI SDK

⚡ Tiny, schema-first SDK for building AI apps — typed outputs, streaming, flows, and provider-agnostic adapters.

2 lines to typed, streaming AI magic.

2 min read
Beginner

✨ Features

serverCompose

Schema-validated outputs with Zod (no brittle JSON parsing)

useCompose

Stream tokens into UIs with optional structured events mid-stream

flowBuilder

Multi-step flows with built-in retries + typed outputs

Provider-agnostic

Plug in OpenAI, Anthropic, Gemini (adapters coming soon)

Mocks included

Instant demos and tests, no API keys required

Secure by default

Safe prompt interpolation, PII redaction, opt-in telemetry

1
🚀 Quickstart - Install
Install
pnpm add @actionpackd/sdk-core zod
2
Use
Basic Example
import { createProvider, serverCompose } from '@actionpackd/sdk-core';
import { z } from 'zod';

// Create a provider (use real adapters or mocks)
const openai = createProvider({ id: 'openai', apiKey: process.env.OPENAI_KEY });

// Define schema
const ProductSchema = z.object({
  title: z.string(),
  bullets: z.array(z.string()),
});

// Get typed output
const product = await serverCompose({
  provider: openai,
  prompt: 'Write product JSON for {{name}}',
  inputs: { name: 'Cord Jacket' },
  schema: ProductSchema,
});

console.log(product.title); // ✅ typed, validated
💻 Examples

Simple demo

packages/sdk-core/examples/simple-demo.ts

Next.js starter

packages/sdk-core/examples/next-starter/ (deploy to Vercel)

Multi-model demo

run with pnpm demo:multi

📦 Packages

This repo is a monorepo managed with pnpm workspaces.

@actionpackd/sdk-core

the core SDK (you're here)

@actionpackd/provider-openai

adapter for OpenAI (coming soon)

@actionpackd/provider-anthropic

adapter for Anthropic (coming soon)

@actionpackd/provider-gemini

adapter for Gemini (coming soon)

@actionpackd/ui

optional React UI components (future)

🔒 Security
Safe template interpolation (no eval)
Built-in PII redaction for logs
Secrets scanning in CI
Telemetry is opt-in only

See SECURITY.md for details.