Skip to main content
This quickstart takes you from an empty project to running a saved Figranium task through the SDK. You will construct a typed Task, save it to the server, and execute it with runtime variables.
1

Install the SDK

Install @figranium/sdk in your project and make sure you are on Node.js 18 or newer.
2

Create the client

Point the client at your Figranium server and pass your API key. baseUrl defaults to http://localhost:11345.
3

Define and save a task

Use the actions helpers and the variable() template helper to build a typed task, then save it with tasks.save.
variable("query") produces Figranium’s {$query} template token. Every action helper generates a stable, unique action ID.
4

Run the task

Execute the saved task with runtime variables. runTask is a convenience wrapper around tasks.run.

Full example

basic.ts

Direct execution without saving

You can also call scrape, agent, and headful directly for one-off runs:
See Execution resource for the full API.

Next steps

Actions and variables

Build task action lists with the typed helpers.

Streaming

Subscribe to live execution events over Server-Sent Events.

Errors

Handle FigraniumError and inspect status, code, and details.

Tasks resource

Full reference for creating, versioning, and running tasks.