@stemp/node
v0.1.0
Published
Official Node.js/TypeScript SDK for the Stemp API
Downloads
6
Maintainers
Readme
Installation
npm install @stemp/nodeQuick Start
import { Stemp } from '@stemp/node';
const stemp = new Stemp({ apiKey: 'sk_live_...' });
// List templates
const { data } = await stemp.templates.getTemplates();
// Send notification to all passes of a template
await stemp.notifications.sendToTemplate({
path: { templateId: 'tpl_123' },
body: { message: 'New reward available!' },
});
// Add a stamp
await stemp.stamps.addStamp({
path: { passId: 'pass_456' },
});
// Add points
await stemp.points.addPoints({
path: { passId: 'pass_456' },
body: { amount: 100 },
});
// Manage webhooks
const { data: endpoints } = await stemp.webhooks.listEndpoints();Configuration
const stemp = new Stemp({
apiKey: 'sk_live_...', // Required: your API token
baseUrl: 'https://api.stemp.app/api', // Optional: defaults to production
});Available Namespaces
| Namespace | Description |
|-----------|------------|
| stemp.templates | Template CRUD operations |
| stemp.notifications | Send push notifications |
| stemp.stamps | Stamp card operations |
| stemp.points | Points/loyalty operations |
| stemp.pointsConfig | Points configuration |
| stemp.pointsRedemptions | Points redemption management |
| stemp.pointsRewardTiers | Reward tier management |
| stemp.walletPass | Wallet pass operations |
| stemp.webhooks | Webhook endpoint management |
| stemp.apiKeys | API key management |
| stemp.organizations | Organization management |
| stemp.users | User management |
| stemp.apps | App management |
| stemp.templateAssets | Template asset management |
| stemp.templatePresets | Template presets |
| stemp.stampConfig | Stamp configuration |
| stemp.stampRewards | Stamp rewards |
Advanced: Custom Client
For full control, use the generated SDK classes directly:
import { createClient, createConfig, TemplateApi } from '@stemp/node';
const client = createClient(createConfig({
baseUrl: 'https://api.stemp.app/api',
auth: () => 'sk_live_...',
}));
const templates = new TemplateApi({ client });
const { data } = await templates.getTemplates();License
MIT
