@open-send/sdk 1.0.0 is built and not on npm yet. Every version is listed here.
1 version
Generated from the API's own list of methods, so every method has one typed call.
A typed call for every method
Every method a key may call has one typed call, generated from the API's own list. It has no dependencies, runs on Node.js 20.3 and up, Bun, Deno and edge runtimes, as ES modules or CommonJS, and refuses to start in a web page, where anyone could read its key.
SDKErrors you can branch on
Every failure throws one error type with a code to branch on, and a refusal from the API carries its request id. A call stops after 30 seconds unless you set another limit.
ErrorsYour own fetch and timeout
Pass your own fetch and a timeout, for tests, proxies or runtimes without a global fetch.
Safe repeats and cancelling
Pass an idempotency key so a repeated send goes out once, and an AbortSignal to give up on a call.
Check webhook signatures
verifyWebhook checks a delivery against your endpoint's signing secret, returns the event and refuses one more than 5 minutes old, unless you set another limit.
Settings from the environment
With no key passed, the client reads OPENSEND_API_KEY. It calls the hosted API by default, and OPENSEND_API_URL points it at a server of your own.
Create a key and send, or clone the repository and run it yourself.