kawnix
v0.2.0
Published
Type-safe SDK for the Kawnix protocol
Readme
kawnix
Type-safe SDK for Kawnix protocol operations.
Install
bun add kawnix
# or
npm install kawnixDevelopment
Using Bun:
bun install
bun run type-check
bun run buildUsing Node.js/npm:
npm ci
npm run type-check
npm run buildQuickstart
import { createKawnixClient } from 'kawnix';
const client = createKawnixClient({
baseUrl: 'https://api.kawnix.com',
apiKey: process.env.KAWNIX_API_KEY,
});
const invocation = await client.invocations.execute({
endpointId: 'ep_123',
input: { prompt: 'Draft a support reply' },
});
const receipt = await client.receipts.getById(invocation.receiptId);Namespaces
client.providers.*client.manifests.*client.invocations.*client.receipts.*client.credentials.*client.billing.*
Browser Safety
By default, API key auth is blocked in browser contexts. Use backend proxy/session patterns for browser applications.
Manifest Lifecycle
await client.manifests.validate({ payload: jsonManifest, format: 'JSON' });
await client.manifests.publish({ endpointId, version: '1.0.0', payload: jsonManifest });
await client.manifests.activateVersion(endpointId, '1.0.0');Credentials
const created = await client.credentials.createApiKey({
name: 'SDK production key',
scopes: ['manifest:read', 'endpoint:invoke', 'receipt:read'],
});
console.log(created.keyId);