Skip to main content
It ships ESM and CommonJS, its own types, and has no dependencies. It needs Node 20 or newer, or any runtime with fetch and Web Crypto.

Send an event

Every operation in the API is a method named after it: lurk.rules.list(), lurk.units.get({ id: "beans" }), lurk.users.get({ id: "maya@example.com" }), lurk.units.use({ ... }). Groups are camelCase (lurk.apiKeys, lurk.webhookEndpoints). Inputs and answers are typed from the API’s own description, so a mistake in a field name is a compile error.

Configure

Per call, the second argument takes the same kind of settings:

Errors

A LurkError has status, code, param, requestId, docUrl, nextStep and, for rate_limited, retryAfterSeconds. Branch on code, show message, and quote requestId to support. Be ready for a code you have not seen: Lurk adds codes, fields and event types over time and never removes one inside a version (versioning).

Pages

More.

Webhooks

Pass the raw body, not parsed JSON. The whole page.

Types

Every request and answer type is exported: import type { Rule, Unit, EventsSendInput } from "@getlurk/sdk".

In a browser

It runs there, but a project key must not. Call Lurk from your server, and give the browser your own endpoint.

Testing

@getlurk/sdk/testing gives you a real client with no network. Testing your code.