A modular TypeScript SDK for integrating with the CodeVF API. Submit tasks for human review, manage projects, track credits, and leverage engineer expertise levels.
- Project Management - Create and organize projects for grouping API tasks
- Task Submission - Submit tasks for human engineer review with customizable service levels
- Credit System - Monitor your credit balance and usage across tasks
- Engineer Expertise - Select engineer expertise levels with cost multipliers
- File Attachments - Attach screenshots, logs, code files, and documents to tasks
- Comprehensive Error Handling - Typed error classes for all HTTP status codes and failure modes
bun installimport { createClient, createProject, createTask } from 'codevf-js-sdk';
// Initialize the SDK
const client = createClient({ apiKey: 'your-api-key' });
// Create a project
const project = await createProject(client, {
name: 'My API Project',
description: 'Project for API integration'
});
// Submit a task for review
const task = await createTask(client, {
prompt: 'Review this authentication system',
projectId: project.id,
maxCredits: 100,
mode: 'fast'
});
// Check task status
const status = await getTask(client, task.id);
// Check credit balance
const balance = await getBalance(client);The SDK follows a modular architecture with strict separation between internal core logic and public API modules:
- Core (
/src/core) - Internal HTTP client, authentication, error handling, and configuration - Modules (
/src/modules) - Public feature domains: projects, tasks, credits, tags - Types (
/src/types) - Shared TypeScript interfaces used across modules
createProject(client, data)- Create a new project for grouping tasks
createTask(client, data)- Submit a task for human engineer reviewgetTask(client, taskId)- Retrieve task status and resultscancelTask(client, taskId)- Cancel a pending or in-progress task
getBalance(client)- Check current credit balance, available and on-hold amounts
getTags(client)- Get available engineer expertise levels with cost multipliers
The SDK provides typed error classes for granular error handling:
BadRequestError(400) - Invalid parameters or malformed requestAuthError(401) - Invalid or missing API keyInsufficientCreditsError(402) - Not enough credits to complete taskNotFoundError(404) - Resource not found or access deniedConflictError(409) - Idempotency conflictPayloadTooLargeError(413) - Request exceeds size limitRateLimitError(429) - Rate limit exceededServerError(500) - Internal server errorNetworkError- Connection or timeout issues
bun testTests are organized in /tests directory with the same structure as source code. Uses vitest for testing framework.
This project uses Bun as the runtime and build tool:
bun run index.ts- Execute main entry pointbun test- Run test suitebun docs- Generate TypeDoc documentationbun run build- Build TypeScript to JavaScript in/distdirectory
To publish a new version of this SDK to npm:
-
Update the version in
package.json:npm version patch|minor|major
-
Build the distribution files:
bun run build
-
Ensure all tests pass:
bun test -
Publish to npm:
npm publish
The package will be published under the scope codevf-js-sdk with all distribution files and documentation included.
- Bun v1.3.6+
- TypeScript 5+
- npm account for publishing
MIT