Skip to content

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.

typescript
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? ​

ResourceUse it toPage
uploadsPublish video, photos, text and documents; schedule; save drafts; poll status; retry; archiveUploads
mediaUpload and manage reusable filesMedia
aiGenerate captions and hashtagsAI
analyticsAggregate stats, per-post metrics, follower growth, account comparisonAnalytics
engagementBackfill engagement metrics, re-enable paused insightsEngagement
webhooksRegister endpoints and inspect deliveriesWebhooks
workspacesWorkspaces, connections, refresh and reconnect, members, invitations, API keys, usageWorkspaces, Connections

The full list of method signatures is on the method reference.

How do I install it? ​

bash
pnpm add @socifyr/sdk

See 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.

Next steps ​