SDKsAPI

Pick the package that fits your stack

The TypeScript SDK wraps the hosted FoPost API with full types. The PHP core, Laravel wrapper, and WordPress plugin are MIT-licensed and publish straight from your own server with your own platform credentials. Anything else generates from the OpenAPI spec.

npm install @fopost/sdk
import { FoPost } from '@fopost/sdk';

const client = new FoPost({ apiKey: process.env.FOPOST_API_KEY });

const [workspace] = await client.workspaces.list();
const accounts = await client.accounts.list({ workspaceId: workspace.id });

const post = await client.posts.create({
  workspaceId: workspace.id,
  status: 'scheduled',
  scheduleAt: '2026-09-01T09:00:00Z',
  content: [{ text: 'Shipped a new release today.', position: 0 }],
  accounts: accounts.map((a) => ({ id: a.id })),
});

TypeScript, fully typed

Every endpoint, request body, and response has a type. Autocomplete does the reading.

PHP without an account

The core and Laravel packages run on your server and need no hosted account.

OpenAPI spec

Served from the API itself, so a generated client never drifts from production.

TypeScript

The whole API as typed methods

@fopost/sdk covers posts, deliveries, accounts, workspaces, labels, and the AI caption, rewrite, and repurpose helpers. It runs in Node and edge runtimes, retries transient errors, and surfaces rate-limit headers so you can back off. The MCP server is built on it.

Read the SDK docs
Deliveries and account health
const deliveries = await client.posts.deliveries(post.id);
for (const d of deliveries) {
  console.log(d.platform, d.status, d.externalUrl);
}

const health = await client.accounts.health(account.id);
console.log(health);

Every resource

One client object, one method per endpoint, typed end to end.

Retries and backoff

Network blips and 429s are retried before an error reaches you.

Same core as MCP

@fopost/mcp uses this SDK, so agent and script behave the same way.

PHP

Publish from PHP with your own credentials

fopost/social-core is a standalone publishing library with an adapter per network and zero framework dependencies. fopost/social-laravel adds a service provider, facade, events, and queue support. Neither talks to the hosted product; you bring platform credentials and it posts directly.

See the PHP packages
composer require fopost/social-laravel
use FoPostLaravelFacades${BRAND.name};

$result = FoPost::linkedin('Shipped a new release today.');

if ($result->success) {
    logger()->info("Published: {$result->externalUrl}");
}

MIT, on your server

Composer install, no account, no key, no usage limits from us.

Laravel wiring

Config, facade, events, and queued publishing out of the box.

Same formatting rules

Length limits and media handling match the hosted adapters.

WordPress and everything else

A plugin for WordPress, a spec for the rest

The WordPress plugin is built on the PHP core, so publishing a blog post to your social accounts is a checkbox in the editor. For any other language, the OpenAPI spec is served live from the API; point a generator at it and get a client that matches what is deployed today.

Start building
OpenAPI
curl https://api.fopost.com/v1/openapi.json -o openapi.json

npx @openapitools/openapi-generator-cli generate \
  -i openapi.json -g python -o ./client

WordPress plugin

Install from the plugin directory and share posts as you publish them.

Live spec

GET /v1/openapi.json always describes the running API.

Any language

Python, Go, Ruby, or anything with an OpenAPI generator.

SDKs questions, answered

Which packages need an account?

The TypeScript SDK and the MCP server talk to the hosted API, so they need a FoPost account and an API key. The PHP core, Laravel package, and WordPress plugin need neither.

What is the difference between the PHP package and the TypeScript SDK?

The SDK is a client for the FoPost API: you get scheduling, the queue, retries, analytics, and every connected account. The PHP package is a standalone library that posts directly to each network with credentials you supply, and no hosted service is involved.

Is the TypeScript SDK open source?

Yes. It is MIT-licensed and published on npm as @fopost/sdk. The MCP server, @fopost/mcp, is MIT as well.

Does the SDK work in the browser?

It runs anywhere fetch exists, but an API key is a server secret. Call it from a server, an edge function, or a CLI, never from client-side code.

Does the WordPress plugin use the hosted service?

No. It is built on the PHP core and publishes from your WordPress server with credentials you connect in the plugin settings.

How do I get a client in another language?

Download the OpenAPI spec from the API and run it through the generator for your language. The spec is versioned with the API, so regenerate whenever you upgrade.

Build on the SDKs today

Starting is free and the full API is included. Create a key and make your first call in minutes.

Get your API key