SDK overview
@lazrus/nukle is the official TypeScript SDK for the Nuklē API. It ships two
focused clients:
| Client | Use it for | Safe in the browser? |
|---|---|---|
createNukleClient | Content and media reads | Yes |
createNukleFormClient | Sending data to one public form | Yes |
Create and manage form schemas in Studio. A website API key only reads that
website's enabled content and media. Browser requests are accepted only from
the domain configured for the website in Studio; server requests can read
without an Origin header.
All API failures throw NukleApiError. The error includes an HTTP status, a
stable code, and optional details returned by Core.
import { NukleApiError } from '@lazrus/nukle';
try {
// Call an SDK method here.
} catch (error) {
if (error instanceof NukleApiError) {
console.error(error.status, error.code, error.message);
}
}
The SDK accepts a custom fetch implementation when your runtime needs one.