TL;DR, Quick Answer
5 min read@adaptlypost/sdk is a typed TypeScript client for the AdaptlyPost API. npm install @adaptlypost/sdk, pass an adaptly_ API key (or set ADAPTLYPOST_API_KEY), and call adaptly.posts.create to publish or schedule on Instagram, TikTok, YouTube, X, LinkedIn, Facebook, Pinterest, Threads, Bluesky, Mastodon, Telegram, Google Business Profile, Tumblr and WordPress. It runs on Node 20.3+, Bun, Deno, edge runtimes and the browser with no dependencies. It uploads media through presigned URLs, pages through lists with listAll, retries 429s after Retry-After, never retries a create after a 5xx, throws typed errors such as PostValidationError, and verifies webhook signatures with constructWebhookEvent. Every type comes from the API's OpenAPI document.
The AdaptlyPost social media SDK, @adaptlypost/sdk, lets TypeScript code publish and schedule posts on 14 networks, upload media, connect your clients' accounts and check webhook signatures, with every request and response typed from the API's OpenAPI document. It has no dependencies and runs anywhere fetch does.
I'd been writing the same wrapper in every project: a fetch helper, a retry loop that got 429s wrong, hand-typed response shapes that drifted from the API. The SDK replaces that wrapper. Your editor knows every field of a post, the compiler catches a misspelled contentType, and the retry rules are the ones the API was built for.
The short version: npm install @adaptlypost/sdk, create a key at adaptlypost.com/api-tokens, then call new AdaptlyPost({ apiKey }).posts.create(...).
What does the AdaptlyPost SDK cover?
The SDK covers the whole AdaptlyPost REST API: posts, media, connected accounts, connect links, the inbox, webhooks, analytics, AI captions and images, workspaces and team members. Each area is a property on the client, such as adaptly.posts or adaptly.media.
| Area | Methods worth knowing |
|---|---|
| Posts | create, validate, listAll, publish, retry, update, setLabels |
| Media | upload, which takes bytes and returns public URLs |
| Accounts | accounts.list for the ids posts need |
| Connect links | connectLinks.create, plus parseConnectReturn for the return URL |
| Webhooks | constructWebhookEvent, verifyWebhookSignature |
| AI | ai.generateCaption, ai.generateImage, ai.waitForImage |
| Team | workspaces.create, members.list, invitations.send |
It runs on Node 20.3 or later, Bun, Deno, edge runtimes and the browser.
How do you install the SDK and make the first call?
You install it from npm, create a client with an API key, and list your connected accounts to get the ids posts need. A key from adaptlypost.com/api-tokens starts with adaptly_ and carries the workspace role you picked.

import { AdaptlyPost } from '@adaptlypost/sdk';
const adaptly = new AdaptlyPost({ apiKey: process.env.ADAPTLYPOST_API_KEY });
const { accounts } = await adaptly.accounts.list();
const { postId } = await adaptly.posts.create({
text: 'Our spring collection is live.',
contentType: 'TEXT',
accountIds: accounts.map((account) => account.id),
scheduledAt: '2026-12-08T09:00:00Z',
timezone: 'Europe/Warsaw',
});new AdaptlyPost() with no apiKey reads ADAPTLYPOST_API_KEY from the environment. adaptly.me() returns the key's role and every permission it holds, so a script can check up front whether it may schedule or only draft.

How do you upload images and video?
You upload with adaptly.media.upload, which takes a Blob, ArrayBuffer or Uint8Array (a Node Buffer works) and returns a public URL to put in mediaUrls. It asks the API for presigned URLs and sends the bytes straight to storage.
import { readFile } from 'node:fs/promises';
const [photo] = await adaptly.media.upload({
fileName: 'launch.jpg',
mimeType: 'image/jpeg',
data: await readFile('launch.jpg'),
});
await adaptly.posts.create({
text: 'We launched',
contentType: 'IMAGE',
timezone: 'UTC',
accountIds,
mediaUrls: [photo.publicUrl],
});Pass an array to upload several files in one call, for a carousel or a post with different media per network.
How does the SDK handle errors and retries?
The SDK retries a 429 after the Retry-After the API sends, and retries reads on 502, 503, 504 and network errors, 2 times by default. It never retries a create after a 5xx, because the post may already exist, so a flaky network can't double-post.
Every failure is an AdaptlyPostError, with subclasses you can catch by what you'd do about them:
| Error | When |
|---|---|
PostValidationError | A post was refused; issues lists each problem per network |
AuthenticationError | 401: missing, revoked or expired key |
PermissionDeniedError | 403, with code permission_denied, subscription_required or workspace_access_denied |
InsufficientCreditsError | 402: out of AI credits |
RateLimitError | 429 after the retries ran out |
Call adaptly.posts.validate(body) first when the post comes from user input. It runs every check create runs and returns the problems without creating anything.

- A 429, after the Retry-After the API sends
- Reads that hit a 502, 503 or 504
- Reads that hit a network error
- A create after a 5xx
- The post may already exist
How do you let clients connect their own accounts?
You create a connect link with adaptly.connectLinks.create, send the client to its start URL, and read the result with parseConnectReturn when they come back. The client sees the network's own consent screen, and the tokens stay with AdaptlyPost.
const link = await adaptly.connectLinks.create({
allowedPlatforms: ['INSTAGRAM'],
returnUrl: 'https://app.example.com/social/connected?client=42',
});The result carries accountIds, the same ids accounts.list() returns. For an agency or SaaS product, pair it with workspaces.create and adaptly.withWorkspace(id) to keep each client's accounts in a workspace of their own.
How do you verify webhooks with the SDK?
You verify a webhook with constructWebhookEvent, passing the raw request body, the x-adaptly-signature and x-adaptly-timestamp headers and your whsec_ secret. It returns the parsed event, or throws if the signature doesn't match or the delivery is older than five minutes.
import { constructWebhookEvent } from '@adaptlypost/sdk';
app.post('/webhooks/adaptlypost', express.raw({ type: 'application/json' }), async (req, res) => {
const event = await constructWebhookEvent({
payload: req.body,
signature: req.header('x-adaptly-signature'),
timestamp: req.header('x-adaptly-timestamp'),
secret: process.env.ADAPTLYPOST_WEBHOOK_SECRET,
});
res.sendStatus(200);
});Pass the raw body, before a JSON parser touches it. The social media webhooks guide lists every event, and the unified social media API guide covers the REST endpoints the SDK calls.
SDK, CLI or MCP server?
Use the SDK inside an application, the CLI for scripts and CI jobs, and the MCP server when an AI agent does the posting. All three call the same API with the same key and roles.
The posting API page lists every field per network. For an AI client, the agents page covers the MCP server's 91 tools.
Frequently Asked Questions
Is there a TypeScript SDK for posting to social media?
@adaptlypost/sdk is a TypeScript SDK for posting and scheduling on 14 networks through AdaptlyPost. Every request and response type comes from the API's OpenAPI document.
Does the SDK work in the browser and on edge runtimes?
The SDK runs on Node 20.3 or later, Bun, Deno, edge runtimes and the browser, with no dependencies. Keep the API key on the server; a browser build should call your own backend.
Does the SDK retry failed requests?
The SDK retries 429s after Retry-After, and reads on 502, 503, 504 and network errors, 2 times by default. It never retries a create after a 5xx.
Is the AdaptlyPost SDK free?
The SDK is free on npm. It calls the AdaptlyPost API, which comes with every plan: Creator at $19 a month, Pro at $39 and Enterprise at $89, each with a 7-day free trial.
Can the SDK work across several workspaces?
An OAuth token reaches every workspace its member belongs to. List them with adaptly.workspaces.list() and act in one with adaptly.withWorkspace(id). An API key acts in its own workspace.
Is there an SDK for Python or other languages?
AdaptlyPost publishes the TypeScript SDK. For other languages, generate a client from the OpenAPI document at https://post.adaptlypost.com/post/api/v1/openapi.json.
How do I get an API key for the AdaptlyPost SDK?
Create one at adaptlypost.com/api-tokens. The key starts with adaptly_ and carries the workspace role you picked. Pass it as apiKey, or set ADAPTLYPOST_API_KEY and call new AdaptlyPost() without it.
How do I schedule a social media post in TypeScript?
Call adaptly.posts.create with your text, contentType, accountIds, scheduledAt and timezone. The account ids come from adaptly.accounts.list(). To attach images or video, upload them with adaptly.media.upload first and put the public URLs in mediaUrls.
Which social networks does the AdaptlyPost SDK support?
The SDK posts to Instagram, TikTok, YouTube, X, LinkedIn, Facebook, Pinterest, Threads, Bluesky, Mastodon, Telegram, Google Business Profile, Tumblr and WordPress. You choose where a post goes by passing the ids of connected accounts.
Can I validate a post before publishing it?
Call adaptly.posts.validate(body). It runs every check create runs and returns the problems without creating anything. This is most useful when the post comes from user input.
Put this into practice with AdaptlyPost
Was This Article Helpful?
Let us know what you think!
See us more often in Google
One click marks AdaptlyPost as a preferred source, so our articles sit higher in your Top Stories, AI Mode, and AI Overviews.
Related Articles


Schedule Posts From Your Terminal With a Social Media CLI for 14 Networks
Install the AdaptlyPost social media CLI and schedule posts from your terminal: markdown files, a month from a CSV, threads, media upload and watching results.


How Social Media Webhooks Tell You When a Post Publishes, Fails or Gets a Comment
Set up social media webhooks with AdaptlyPost: signed events when a post publishes or fails, an account disconnects or a comment arrives, on 14 networks.


How a Unified Social Media API Posts to 14 Networks With One Request
What a unified social media API does, and how AdaptlyPost's REST API posts to 14 networks in one request: auth, media, validation, webhooks and limits.

