Skip to content

Install the Socifyr TypeScript SDK ​

Install @socifyr/sdk with your package manager, create a client with an API key, and call workspaces.list() to confirm it works.

How do I install @socifyr/sdk? ​

bash
pnpm add @socifyr/sdk
bash
npm install @socifyr/sdk
bash
yarn add @socifyr/sdk
bash
bun add @socifyr/sdk

Which runtimes does it support? ​

The package declares node >= 18.0.0 and uses the built-in fetch, FormData, Blob and AbortController. It also imports node:crypto for webhook verification, so the runtime must provide that module.

RuntimeNotes
Node.js 18+Supported
BunUses the same global APIs
BrowserDo not use. An API key in client code is exposed to every visitor

The package ships ESM, CJS and TypeScript declarations. I did not test Deno or edge runtimes while writing this page, so verify them yourself before relying on them.

How do I make my first call? ​

Create an API key in the dashboard (see API keys).

typescript
import { Socifyr } from '@socifyr/sdk'

const socifyr = new Socifyr({
  apiKey: process.env.SOCIFYR_API_KEY!,
})

const workspaces = await socifyr.workspaces.list()
console.log(workspaces.map((w) => w.name))

The constructor throws a plain Error if apiKey is empty. It does not read environment variables for you, so pass the key in as shown.

What if the first call fails? ​

SymptomCauseFix
AuthenticationError (401)Wrong or revoked keyCreate a new key, check the sk_ prefix
PermissionError (403)Key cannot access that workspace or actionCheck the key's workspace and the member role
SocifyrError with code: 'network_error'DNS, TLS or proxy problemCheck apiUrl and outbound access

See Errors for every error class.

Next steps ​