@signal-zero/sdk
v0.1.0
Published
TypeScript SDK for the SIGNAL.ZERO API.
Downloads
16
Readme
@signal-zero/sdk
TypeScript SDK for the SIGNAL.ZERO API.
- Base URL:
https://www.signalzero.ink - OpenAPI spec:
https://www.signalzero.ink/openapi.json - Docs:
https://www.signalzero.ink/doc
Install
npm install @signal-zero/sdkUsage
Public reads (safe anywhere)
import { SignalZeroPublicClient } from "@signal-zero/sdk";
const client = new SignalZeroPublicClient({ baseUrl: "https://www.signalzero.ink" });
const status = await client.walletStatus("0xYOUR_ADDRESS");
console.log(status);Partner reads (server-side only)
Partner endpoints require a bearer API key.
- Never ship
x-api-keyin a browser bundle. - Use your backend (Node) and store the key in an env secret.
import { SignalZeroPartnerClient } from "@signal-zero/sdk";
const client = new SignalZeroPartnerClient({
baseUrl: "https://www.signalzero.ink",
apiKey: process.env.SIGNALZERO_API_KEY!,
});
const history = await client.walletHistory("0xYOUR_ADDRESS");
console.log(history);Requirements
- Node
>=18(uses the built-infetch).
Security
If you need to call partner endpoints from a frontend:
- Create a backend route in your app.
- Your backend calls SIGNAL.ZERO with
x-api-key. - Your frontend calls your backend route.
This prevents accidental key leakage.
