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/sdkbash
npm install @socifyr/sdkbash
yarn add @socifyr/sdkbash
bun add @socifyr/sdkWhich 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.
| Runtime | Notes |
|---|---|
| Node.js 18+ | Supported |
| Bun | Uses the same global APIs |
| Browser | Do 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?
| Symptom | Cause | Fix |
|---|---|---|
AuthenticationError (401) | Wrong or revoked key | Create a new key, check the sk_ prefix |
PermissionError (403) | Key cannot access that workspace or action | Check the key's workspace and the member role |
SocifyrError with code: 'network_error' | DNS, TLS or proxy problem | Check apiUrl and outbound access |
See Errors for every error class.