Post to X, LinkedIn, YouTube and five more platforms with one TypeScript call.
Open source (MIT). Each platform returns its own result: published, processing, or failed with the reason.
npm i @opencoredev/social-sdk
direct adapters, no middleman:
What you get back
One outcome per target. Not a boolean. The actual state: "published", "processing", "accepted", "failed", "unknown", and more, with the reason when there is one.
Each target is checked before anything is sent. A text-only post aimed at Instagram fails local preparation, and no target is dispatched.
Switch on the state, and TypeScript tells you when a new one isn't handled.
import type { DeliveryOutcome } from "@opencoredev/social-sdk"; function renderOutcome(outcome: DeliveryOutcome): string { const target = `${outcome.account.platform}/${outcome.account.accountId}`; switch (outcome.state) { case "published": return `${target}: published (${outcome.post.postId})`; case "scheduled": return `${target}: scheduled (${outcome.job.jobId})`; case "accepted": return `${target}: accepted`; case "processing": return `${target}: processing`; case "failed": return `${target}: failed (${outcome.code})`; case "unknown": return `${target}: status unknown (${outcome.reason})`; case "cancelled": return `${target}: cancelled`; case "not-submitted": return `${target}: not submitted (${outcome.reason})`; default: return unreachable(outcome); } } function unreachable(value: never): never { throw new Error(`Unhandled delivery outcome: ${String(value)}`); }
Pick your setup
What changes is who registers the platform apps and keeps the tokens.
Direct
Use your own platform apps. You handle each platform's app review and tokens, and pay any API fees the platform charges.
Platform guides →Managed backend
A provider connects the accounts and holds the tokens, on its own account and pricing. Postiz can also be self-hosted, but then you register your own platform apps.
Social SDK Cloud
Our hosted version will run the platform apps and token refresh for you. Join the waitlist to hear when it opens.
Join the waitlist →Not sure which one? Compare the routes in the docs.
What it does.
Publishing
Pick the accounts, make one call, get a result for each. Retry with the same idempotency key and a durable store, and the post isn't sent twice.
no double postsReads & analytics
Read your posts and their metrics where the platform offers them. A number the platform doesn't return is left out, not shown as zero.
no made-up zerosComments & messages
Read and reply to comments and DMs where the platform's API allows it. Each adapter lists what it supports, so you can check before you call.
where platforms allowDeterministic testing
A mock backend with fixed scenarios, fixtures and a fake clock, so your tests never call a real platform.
runs offlinethanks to our sponsors
open source, MIT licensed, and on npm today. if it saves you a weekend, star it on GitHub. logos and colors live on the brand page.