social SDK
/ˈsoʊ·ʃəl ˌɛs·diː·ˈkeɪ/ · noun
- 1. a typed toolkit for building social features into your app.
- 2. the route from your code to every platform, with a real answer from each.
bun add @opencoredev/social-sdk
shoutout to our sponsors
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.
import { createSocial } from "@opencoredev/social-sdk"; const social = createSocial({ backend }); const result = await social.posts.publish({ content: { text: "we drew our landing page" }, targets: accounts.map((account) => ({ account })), }); for (const o of result.outcomes) { // "published" | "processing" | "failed" | ... console.log(o.account.platform, o.state); }
import { createSocial } from "@opencoredev/social-sdk"; const social = createSocial({ backend }); const result = await social.posts.publish({ content: { text: "we drew this" }, targets: accounts.map( (account) => ({ account }), ), }); for (const o of result.outcomes) { // published | processing | failed console.log( o.account.platform, o.state); }
Everything it does.
Publishing
Explicit targets, explicit accounts, one outcome per destination. Retries that reuse an idempotency key with a durable store are deduplicated.
unknown means reconcileReads & analytics
Typed references to native content, plus platform analytics products where
available. Missing metrics are left out, not reported as zero. Unsupported reads
fail with unsupported_capability.
Comments & messages
Replies, reactions, conversations, and native platform operations, with capability declarations for normalized routes and explicit authorization for native access.
where platforms allowDeterministic testing
A mock backend with deterministic scenarios, fixtures, and a fake clock, so CI never touches a live network.
runs offlineopen 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.