PostSpoke is a scheduler I built where you write once and publish or schedule to many networks. It supports 17 today. This is how it's put together and what went wrong on the way.

The stack is Node, Express and TypeScript on the backend, Postgres with Drizzle, pg-boss for jobs, and Expo (React Native) for the web and native clients.

One adapter per platform, one contract

Every platform has a class that extends a tiny base:

export abstract class BaseAdapter { abstract publish(payload: PublishPayload): Promise<PublishResult>; } 

The payload carries the text, media URLs, the decrypted token, the platform account ID, and for threads a list of parts. The result is a remote post ID and, where there is one, a URL. The scheduler keeps a map from platform name to adapter class (bluesky, mastodon, devto, ghost and so on) and builds a payload per target account.

The contract stays small, but the abstraction leaks in the usual places. A social network wants text and maybe an image. A blog wants a title and a body. Video-first platforms like YouTube want only the video, and image-first ones like Pinterest prefer the image. So before a payload reaches an adapter, a per-platform filter picks which of the attached media that platform can take.

OAuth or a token: it depends on the platform

Connecting accounts was most of the work, because no two platforms agree.

  • Server-side OAuth: Facebook, Instagram, LinkedIn, Pinterest, Tumblr, YouTube and WordPress.com. These need a registered developer app, and several need a review before real users can connect.
  • Mastodon is OAuth, but there is no single server. The user types an instance (mastodon.social or their own), and the app registers itself on that instance at connect time.
  • Paste-in credentials: Bluesky takes a handle plus an app password and logs in with com.atproto.server.createSession. Dev.to, Ghost (an Admin API key), Hashnode and Medium take a token or key. Telegram takes a bot token plus a chat ID, stored together as JSON.
  • Substack has no public API at all. The adapter uses the private web endpoints other open-source tools use, with your session cookie. Creating a draft is one request and publishing it is another. My first version sent a made-up is_published: true flag on the first request, which Substack ignored, so I got drafts that looked like successes. Publishing now is the second call, and the connection is documented as fragile.

All tokens are encrypted before they're stored (AES through crypto-js, key from the environment). If a publish fails with an authorization error, the account is flagged inactive so the Channels screen shows "reconnect needed".

Long posts become threads

Bluesky allows 300 characters and Mastodon 500. If a post is longer, PostSpoke can split it into a reply chain. The rule for where to cut is small:

  1. Look at the window of text that fits.
  2. Cut at the last sentence end in the second half of the window.
  3. If there isn't one, cut at the last space.
  4. If there isn't one either (one very long word), hard cut, taking care not to split an emoji's surrogate pair.

Ignoring sentence ends in the first half stops a short opener from becoming a part of its own.

Two details cost me time. Lengths are JavaScript string lengths (UTF-16 units). That is never smaller than Bluesky's grapheme count or Mastodon's character count, so every part fits, but parts can come out a little shorter than they need to be. And Mastodon counts every link as 23 characters, so a short link costs more than its length. I reduce the limit by the difference for each link before splitting.

You can also choose the breaks yourself: a line containing only --- splits the post there on Bluesky and Mastodon. On blog platforms (Dev.to, Hashnode, Ghost, WordPress, Medium, Substack) the same line is a Markdown horizontal rule, so it is left alone. A per-user setting picks what happens to over-long text: thread (Bluesky and Mastodon) with other networks trimmed, trim everywhere, or leave it unchanged.

Scheduling on Postgres, retrying only what failed

I didn't want a second piece of infrastructure, so jobs run on pg-boss, which keeps its queue in Postgres. Publishing now and scheduling for later are the same thing: a publish-post job, with a start time for the scheduled ones.

When the worker picks up a job, it first claims the post atomically by setting its status to publishing. A second job for the same post can't run at the same time. A claim older than five minutes is treated as left over from a crashed worker, and each channel (and each thread part) refreshes it while running, so a live run never looks stale.

The post has several target accounts, and each one gets its own result row. That is what makes partial failure manageable. If four of five go out and one fails, the post is marked failed, the four keep their results, and Retry only publishes to the failed target. Before each run the worker loads earlier successes and skips those accounts. There's a second layer for threads: progress is saved after every part, with a hash of the planned parts. A retry resumes after the parts already posted. If the text changed in the meantime, the hash differs, it restarts from part 1, and it says so in the error.

What testing each platform taught me

I connected every platform on production and published one real post to each, then checked the post on the platform itself. 15 of 17 passed this test. Medium and WordPress.com didn't get tested: I have no Medium token, and my WordPress.com account had no site. Here's what went wrong with the rest.

Telegram: the chat ID changed. I made my bot an admin of a private group. That upgraded it to a supergroup, so the ID went from a short negative number to one starting with -100, and the bot dropped out of the group. Connecting failed with "Invalid Chat ID". The fix was to re-add the bot and use the new ID. The connect step now also asks Telegram what kind of chat it is and refuses a group saved as a channel.

Hashnode: the endpoint moved. The old GraphQL address now redirects to an announcement about a paid API. The working endpoint is gql-beta.hashnode.com, and the API needs a Pro account. At connect time the adapter creates and deletes a draft as a probe, so free blogs are refused with a clear message instead of failing on the first publish.

LinkedIn: personal profiles only. Posting to a personal profile works. Company Pages need LinkedIn's Community Management API, which I don't have, so the UI says so rather than offering a button that fails.

Ghost: a check that checked nothing. My "is this key valid" step called an endpoint that Ghost serves without authentication, so any key passed and I stored a fake account. It now checks against an authenticated endpoint, and pasted site addresses are normalized before use.

Meta: the review demo. Facebook and Instagram were approved, but Threads was rejected because the screencast didn't match the stated use case. The lesson is to record each screencast from a real run, starting at the OAuth consent screen and ending with a real publish, and to make it show exactly the permission you asked for. Threads is still not live in PostSpoke.

I also hit two plain configuration mistakes: one platform's client ID variable held another platform's app ID, and a Pinterest app lacked the production redirect URI. Neither is interesting, but both look exactly like "OAuth is broken".

What's missing

X, TikTok, Threads and Reddit aren't supported. There are no team seats and no public API yet. Substack is unofficial and may break.

PostSpoke is free during the beta with no card, and anyone who joins during the beta gets 3 months free on any paid plan later. If you want to try it, it's at https://postspoke.com/?utm_source=devto&utm_medium=social&utm_campaign=week1_launch. Which network would you want next, and how do you test integrations that depend on someone else's API?