
Product
Introducing Immutable Scans
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.
@x402tools/client
Advanced tools
Official JavaScript/TypeScript SDK for Stakefy - Usage-based billing infrastructure.
npm install @stakefy/client
const { StakefyClient } = require('@stakefy/client');
const stakefy = new StakefyClient('sk_pro_xxxxx');
// Create an envelope
const envelope = await stakefy.createEnvelope({
name: 'API Calls - November',
timeWindow: 'MONTHLY',
capacity: 10000,
currency: 'USD',
ownerAccountId: 'org_123'
});
// Record usage
const result = await stakefy.recordUsage({
envelopeId: envelope.id,
amount: 5,
identity: 'user@company.com',
identityType: 'EMAIL'
});
console.log(`Remaining: ${result.remaining}`);
new StakefyClient(apiKey, baseURL?)Creates a new Stakefy client.
apiKey (string, required) - Your API key from the dashboardbaseURL (string, optional) - Custom API URL (defaults to production)createEnvelope(data)Create a new envelope for tracking usage.
await stakefy.createEnvelope({
name: string,
timeWindow: 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY',
capacity: number,
currency: string,
ownerAccountId: string
});
getEnvelope(id)Get envelope details.
const envelope = await stakefy.getEnvelope('envelope_id');
recordUsage(data)Record usage against an envelope.
await stakefy.recordUsage({
envelopeId: string,
amount: number,
identity: string,
identityType: string,
metadata?: object
});
Full TypeScript support included:
import { StakefyClient } from '@stakefy/client';
const stakefy = new StakefyClient('sk_pro_xxxxx');
// Fully typed!
MIT
FAQs
Official Stakefy JavaScript/TypeScript client for usage-based billing
We found that @x402tools/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.