TypeScript SDK
TypeScript SDK
The @post2all/sdk is the official TypeScript client for the post2all API. It provides typed methods for managing social media posts programmatically.
Install
pnpm add @post2all/sdk
# or
npm install @post2all/sdkQuick Example
import { Post2allClient } from "@post2all/sdk"
const client = new Post2allClient({
apiKey: "amp_your_api_key",
})
// List connected accounts
const { accounts } = await client.listAccounts()
console.log(`Found ${accounts.length} accounts`)
// Create and schedule a post
const { post } = await client.createPost({
type: "text",
socialAccountIds: ["acc_123"],
content: "Hello from the SDK!",
status: "scheduled",
scheduledAt: "2026-06-20T09:00:00Z",
})Features
- Fully typed — Zod-validated responses with TypeScript types
- Multipart uploads — Inline media files without a separate upload step
- Error handling — Typed
Post2allApiErrorwith error code and HTTP status - Node.js & edge — Uses standard
fetch, works everywhere
Links
- Quickstart — Step-by-step setup guide
- API Reference — Complete method reference
- npm
- CLI — Command-line tool built on the SDK