@voltbee/sdk
v0.2.2
Published
VoltBee SDK for license validation
Maintainers
Readme
@voltbee/sdk
License validation for your software.
Install
npm install @voltbee/sdkUsage
import { VoltBee } from '@voltbee/sdk';
const volt = new VoltBee('vb_key_...');
const { valid, plan } = await volt.validate(licenseKey);
if (valid) {
// License is active
}API
new VoltBee(apiKey)
Create a client with your API key from app.voltbee.dev.
volt.validate(licenseKey)
Validate a license key. Returns { valid, plan, license, error }.
volt.activate(licenseKey, deviceFingerprint)
Activate a license on a device. Returns { activated, activationsRemaining }.
volt.deactivate(licenseKey, deviceFingerprint)
Remove a device from a license.
volt.createLicense(options)
Create a new license (requires write permissions).
const license = await volt.createLicense({
productId: 'prod_...',
customerEmail: '[email protected]',
plan: 'pro',
});volt.revoke(licenseKey)
Revoke a license (requires write permissions).
Configuration
const volt = new VoltBee({
apiKey: 'vb_key_...',
productId: 'prod_...', // Default product for validation
baseUrl: 'https://api.voltbee.dev/v1', // Custom API endpoint
});License
MIT
