SDKs
Two official clients, with no runtime dependencies: @wyroapi/sdk (Node.js 18+, TypeScript, ESM and CommonJS) and wyro (Python 3.9+).
npm install @wyroapi/sdk
pip install wyro
Node.js / TypeScript
import { Wyro } from "@wyroapi/sdk";
const wyro = new Wyro({ apiKey: process.env.WYRO_API_KEY });
const post = await wyro.posts.create(
{ text: "…", platforms: ["instagram"], media: [{ url: "https://…/a.jpg" }] },
{ idempotencyKey: crypto.randomUUID() },
);
console.log(post.status, post.preview_url);
for await (const p of wyro.posts.iterate()) console.log(p.id, p.status);
Python
import os, uuid
from wyro import Wyro
wyro = Wyro(api_key=os.environ["WYRO_API_KEY"])
post = wyro.posts.create(
{"text": "…", "platforms": ["instagram"], "media": [{"url": "https://…/a.jpg"}]},
idempotency_key=str(uuid.uuid4()),
)
print(post["status"], post["preview_url"])
for p in wyro.posts.iterate():
print(p["id"], p["status"])
What they include
- Posts: create, get, list (with
next_cursorpagination or an iterator), reschedule, cancel, andbulk(csv, { dryRun })for a CSV. Queue: get, set and next free slots. Limited keys: create, list and revoke. - Accounts: list and disconnect. Connect: the link to connect a real account.
- Metrics:
posts.metrics(id),accounts.metrics(id, range)andanalytics.overview(range). - Media: direct upload (up to 4 MB) and a helper for the presigned upload of larger files.
- Webhooks: set, get, delete, and
verifySignature(secret, timestamp, body, signature). - Partners: create, list, get and delete client workspaces, rotate their key, and
forClient(externalId)to act for a client with your partner token:
const client = wyro.forClient("client-123"); // partner token + X-Wyro-External-Id
await client.posts.create({ text: "…", platforms: ["linkedin"] });
- Errors as a typed exception (
WyroError) withcode,message,fix,statusanddetails(catalog). - Retries on
429and5xx, honoringRetry-After(limits); creates are retried only when you pass anidempotencyKey(idempotency).
Verify a webhook
import { verifySignature } from "@wyroapi/sdk";
const ok = verifySignature(secret, req.headers["x-wyro-timestamp"], rawBody, req.headers["x-wyro-signature"]);