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/sdk

Quick 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 Post2allApiError with error code and HTTP status
  • Node.js & edge — Uses standard fetch, works everywhere

On this page