ezstack
v1.0.5
Published
Official EzStack JavaScript/TypeScript SDK
Readme
EzStack SDK (JavaScript/TypeScript)
A lightweight, typed SDK for EzStack APIs. It handles auth headers and request shaping so you can focus on your app.
Install
npm install ezstack
# or
pnpm add ezstackQuickstart
import EzStack from 'ezstack';
const ez = new EzStack({
apiKey: process.env.EZSTACK_API_KEY!,
});
// EzAuth OTP
const send = await ez.ezauth.otp.send({ destination: '4155551212', channel: 'sms' });
const verify = await ez.ezauth.otp.verify(send.requestId, '1234');Configuration
- apiKey: Required. Sent as
eza-api-keyheader.
Runtime examples
Node.js (ESM)
import EzStack from 'ezstack/';
const ez = new EzStack({ apiKey: process.env.EZSTACK_API_KEY! });Node.js (CommonJS)
const EzStack = require('ezstack');
const ez = new EzStack({apiKey: process.env.EZSTACK_API_KEY });Edge/Deno/Workers
import EzStack from 'ezstack';
// Ensure fetch is available in your runtime (it is on most edge runtimes)
const ez = new EzStack({ apiKey: EZSTACK_API_KEY });
const send = await ez.ezauth.otp.send({ destination: '4155551212', channel: 'sms' });Security notes
- Never expose your server API key to browsers. Use the SDK on the server (Next.js API routes, Node backend, workers) when calling privileged endpoints.
- If you need end-user calls from the browser, mint scoped keys or proxy via your backend.
