The official Vibestreet JavaScript/TypeScript SDK provides a type-safe client for the REST API, along with utilities for building platform adapters.
npm install @vibestreet/sdkyarn add @vibestreet/sdkNote
@types package needed.Create a client instance with your API key or JWT token:
import { VibestreetClient } from '@vibestreet/sdk';
const client = new VibestreetClient({
apiKey: process.env.VIBESTREET_API_KEY,
// or: token: 'eyJhbGciOiJSUzI1NiJ9...',
baseUrl: 'https://api.vibestreet.dev/v1', // optional, default
});const results = await client.skills.search({
query: 'legal reviewer',
tier: ['verified', 'premium'],
category: 'legal',
platform: 'emergE',
limit: 20,
offset: 0,
});
console.log(results.skills); // Skill[]
console.log(results.total); // numberconst install = await client.skills.install({
slug: 'legal-reviewer',
author: 'vibestreet',
version: '2.1.0', // optional — defaults to latest
platform: 'cursor',
});
console.log(install.installId); // string
console.log(install.configPatch); // platform config fragment// Check balance before running a skill
const balance = await client.tokens.getBalance();
console.log(balance.available); // e.g. 450000
// Deduct tokens after inference
await client.tokens.consume({
skillSlug: 'legal-reviewer',
tokensUsed: 2400,
modelId: 'gpt-4o',
metadata: { documentId: 'doc_abc123' },
});Platform adapters bridge the Vibestreet SDK with a specific AI IDE or agent runtime. They implement the PlatformAdapter interface from adapter-sdk.ts:
import type { PlatformAdapter, SkillContext, CapabilityGrant } from '@vibestreet/sdk';
export class MyCursorAdapter implements PlatformAdapter {
readonly platformId = 'cursor';
readonly sandboxLevel = 'full' as const;
async resolveCapabilities(
skillSlug: string,
requested: string[]
): Promise<CapabilityGrant[]> {
// Approve or deny each requested capability
return requested.map((cap) => ({
capability: cap,
granted: this.isAllowed(cap),
reason: this.isAllowed(cap) ? undefined : 'Capability not permitted in this context',
}));
}
async executeSkill(context: SkillContext): Promise<void> {
// Invoke the skill within your platform's sandbox
await yourPlatformSandbox.run(context.skill, context.input);
}
private isAllowed(capability: string): boolean {
const blocklist = ['network:*'];
return !blocklist.some((b) => capability.startsWith(b.replace('*', '')));
}
}Adapter Registration
client.adapters.register(new MyCursorAdapter()). Skills will automatically use the matching adapter for the active platform.