@vellum-flags/sdk-node
v0.0.7
Published
NodeJS SDK for Vellum Feature Flag platform
Maintainers
Readme
Vellum NodeJS SDK
Fully typed SDK for Vellum Feature Flags.
Installation
npm install @vellum/sdk-nodeUsage
import { VellumClient } from '@vellum/sdk-node';
const vellum = new VellumClient('your_environment_api_key', {
apiUrl: 'http://localhost:8787',
refreshInterval: 60000, // Optional: Poll every 60s
});
await vellum.init();
const isNewUiEnabled = vellum.isEnabled('new_onboarding_flow', {
user_id: 'user_123',
email: '[email protected]'
});
if (isNewUiEnabled) {
// Execute feature logic
}Webhook Ingestion
If you have a webhook receiver, you can manually feed payloads to the SDK to ensure immediate synchronization:
// Inside your webhook route
app.post('/webhooks/vellum', (req, res) => {
vellum.handleWebhook(req.body);
res.status(200).send('OK');
});