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 result per platform. Not a boolean. The actual state: "published", "processing", "failed", and more, with the reason when there is one.
The types know what each account can do. A text-only post aimed at Instagram fails in your editor, not in production.
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.
no double postsReads & analytics
Typed references to native content, plus platform analytics products where available. Metrics say "unavailable" when they are.
no wrong dataComments & 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 that behaves like the real ones, 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.