# The @sypnia/run package

> One npm package with subpaths for config, functions, jobs, queues and the API client.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/tools/sdk/

For agents: @sypnia/run package subpaths: /function (handler), /job (job), /queue (queue().send, consumer), /client (typed API client createRun: deploys.create/wait…), CLI via npx @sypnia/run; auth by device-flow session, PAT or deploy token; ESM with types; Node 20+, Bun, Deno.

```bash
npm install @sypnia/run
```

| Import                 | For                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------- |
| `@sypnia/run/function` | `handler()` for [functions](https://run.docs.sypnia.com/apps/functions)                     |
| `@sypnia/run/job`      | `job()` for [scheduled jobs](https://run.docs.sypnia.com/jobs/cron)                         |
| `@sypnia/run/queue`    | `queue(name).send()` and `consumer()` for [queues](https://run.docs.sypnia.com/jobs/queues) |
| `@sypnia/run/client`   | the typed API client, for scripts and your own tools                                        |
| `npx @sypnia/run`      | [the CLI](https://run.docs.sypnia.com/tools/cli)                                            |

```ts
import { createRun } from '@sypnia/run/client';

const run = createRun({ token: process.env.SYPNIA_RUN_TOKEN });
const deploy = await run.deploys.create({ app: 'laespiga', env: 'preview', source: { git: { ref: 'feature/menu' } } });
await run.deploys.wait(deploy.id);
```

The client signs in the same ways as the CLI: a saved device-flow session, a personal access token or a deploy token. It is ESM only, with types, and works in Node 20+, Bun and Deno.
