Socifyr TypeScript SDK
@socifyr/sdk is a typed client for the Socifyr REST API. You construct one Socifyr object with an API key and a workspace ID, then call methods grouped by resource: uploads, media, ai, analytics, engagement, webhooks and workspaces.
import { Socifyr } from '@socifyr/sdk'
const socifyr = new Socifyr({
apiKey: process.env.SOCIFYR_API_KEY!,
workspaceId: process.env.SOCIFYR_WORKSPACE_ID!,
})
const ack = await socifyr.uploads.text({
connections: ['x-myhandle', 'linkedin-mybrand'],
text: 'Shipped v2 today.',
})
console.log(ack.id, ack.requestId)Every call sends Authorization: Bearer <apiKey> and X-Workspace-Id: <workspaceId>, unwraps the { success, data } response envelope, and returns data.
What can I do with the TypeScript SDK?
| Resource | Use it to | Page |
|---|---|---|
uploads | Publish video, photos, text and documents; schedule; save drafts; poll status; retry; archive | Uploads |
media | Upload and manage reusable files | Media |
ai | Generate captions and hashtags | AI |
analytics | Aggregate stats, per-post metrics, follower growth, account comparison | Analytics |
engagement | Backfill engagement metrics, re-enable paused insights | Engagement |
webhooks | Register endpoints and inspect deliveries | Webhooks |
workspaces | Workspaces, connections, refresh and reconnect, members, invitations, API keys, usage | Workspaces, Connections |
The full list of method signatures is on the method reference.
How do I install it?
pnpm add @socifyr/sdkSee Installation for other package managers and runtime support.
What does the SDK not do?
These exist in the REST API but have no method in the TypeScript SDK today:
- Submit for approval, approve and reject (
POST /content/:id/submit-for-approval,/approve,/reject). See the Content API. - Listing and creating connections through OAuth. Account connection happens in the dashboard or through a reconnect link. See connections.
The Python SDK covers a smaller surface. See the parity table.
FAQ
Does the SDK work in the browser?
No. An API key must never ship to a browser. Call the SDK from a server, worker or CI job.
Does it retry failed requests?
Yes, for safe methods only. See Configuration.
Which TypeScript types are exported?
All request and response types, plus the PLATFORMS and WEBHOOK_EVENTS constants, are exported from the package root.