fetch and Web Crypto.
Send an event
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
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
Webhooks
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.