Skip to main content
The Figranium JavaScript SDK installs from npm as @figranium/sdk. It ships parallel ESM and CommonJS builds with bundled TypeScript declarations, so most projects need no additional configuration.

Requirements

  • Node.js 18 or newer (for the built-in global fetch), or a modern browser.
  • A running Figranium server that the client can reach at its baseUrl. Local installs default to http://localhost:11345.

Install

The package has no runtime dependencies, so it adds nothing to your dependency tree beyond itself.
Use Node.js 18 or newer so the SDK can rely on the built-in global fetch. Older Node versions require a polyfill.

Import styles

The SDK works with both import and require.

Verify the install

Call health.check() to confirm the SDK can reach your Figranium server.
verify.ts
A healthy Figranium instance returns a JSON object with status: "ok".

Browsers and bundlers

The SDK is sideEffects: false, so bundlers like Vite, webpack, esbuild, and Rollup tree-shake unused resources. In the browser, use a session-authenticated client ({ session: true }) so cookies are sent. See Authentication.

Next steps

Quickstart

Save and run your first task with the SDK.

Client configuration

Configure baseUrl, timeouts, custom fetch, and default headers.