@runnix/sdk
v0.2.0
Published
TypeScript SDK for Runnix: define durable step functions, emit events, run self-hosted runners (Mode 1), or serve over HTTP (Mode 4).
Maintainers
Readme
@runnix/sdk
TypeScript SDK for Runnix, the PostgreSQL-native, self-hostable workflow orchestration platform. Define durable step functions, emit events, run self-hosted runners (Mode 1), or serve functions over HTTP (Mode 4).
npm install @runnix/sdkimport { Runnix } from '@runnix/sdk'
const runnix = new Runnix({ apiKey: process.env.RUNNIX_API_KEY })
export const welcome = runnix.createFunction(
{ id: 'send-welcome', triggers: [{ event: 'user/created' }] },
async ({ event, step }) => {
const user = await step.run('load-user', () => loadUser(event.data.userId))
await step.sleep('cool-off', '5m')
await step.run('send-email', () => sendEmail(user.email))
},
)
await runnix.emit('user/created', { userId: 'u_123' })See the Runnix docs for the getting-started guide, self-hosting instructions, and the full API reference.
License
Apache-2.0. See LICENSE and LICENSE-notice.md.
