social SDK

/ˈsoʊ·ʃəl ˌɛs·diː·ˈkeɪ/ · noun

  1. 1. a typed toolkit for building social features into your app.
  2. 2. the route from your code to every platform, with a real answer from each.
Read the quickstart or just bun add @opencoredev/social-sdk

shoutout to our sponsors

your app social.posts.publish({ content, targets: everywhere , }) published ✓ published ✓ processing… published ✓ failed + reason accepted published ✓ each destination reports back on its own. no rolled-up "all good." your app social.posts.publish({ content, targets: everywhere , }) published ✓ published ✓ processing… published ✓ failed + reason accepted published ✓ each destination reports back on its own. no rolled-up "all good."

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);
  }
← typed end to end, mocks included

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 reconcile

Reads & 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.

no made-up zeros

Comments & messages

Replies, reactions, conversations, and native platform operations, with capability declarations for normalized routes and explicit authorization for native access.

where platforms allow

Deterministic testing

A mock backend with deterministic scenarios, fixtures, and a fake clock, so CI never touches a live network.

runs offline
don't want to manage tokens yourself? take a managed route: Image Zernio Image Post for Me Image PostFast Image Postiz Buffer

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.