Learn how to setup the Claude Code extension for VS Code to work effectively with Tomba API development.
Quick Use
Direct Documentation Reference
In the Claude Code chat panel, reference our documentation:
Code
Please analyze the Tomba API documentation at https://docs.tomba.io/llms.txt and help me implement email verification in my React component with proper TypeScript types.
Contextual Code Assistance
Select code in your editor and ask Claude Code:
Code
@docs Based on the Tomba API documentation, refactor this email validation function to use Tomba's email verifier endpoint instead of regex validation.
Add Claude Code settings to your VS Code workspace settings:
Code
{ "claude.contextFiles": [".claude/tomba-api.md"], "claude.systemPrompt": "You are a helpful coding assistant. When working with email-related APIs, prioritize using Tomba API patterns from the provided documentation. Always include proper authentication headers and error handling.", "claude.autoContext": { "includeWorkspace": true, "includeOpenFiles": true, "maxFiles": 10 }}
Claude Code Features
1. Inline Code Generation
Use Claude Code directly in your editor:
Select code you want to modify
Right-click and select "Ask Claude"
Type your request with context
Example:
Code
// Select this basic email validationfunction validateEmail(email: string): boolean { const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return regex.test(email);}// Ask Claude: "Replace this with Tomba API email verification"
2. Chat Panel Integration
Open the Claude Code chat panel and reference files:
Code
@file:src/types/api.ts @docsBased on the Tomba API documentation, update my TypeScript interfaces to match all API response types exactly.
3. Multi-file Context
Work across multiple files:
Code
@file:src/services/email.ts @file:src/utils/api.ts @docsI need to refactor my email service to use Tomba API. The current service is in email.ts and uses the API utility in api.ts. Please update both files to integrate Tomba email verification.
Development Workflows
1. API Client Development
Step 1: Create base structure
Code
@docs Create a TypeScript class for Tomba API client with these requirements:- Authentication with API key and secret- All endpoints from the documentation- Proper error handling- Rate limiting support- TypeScript interfaces for all responses
Step 2: Add specific methods
Code
// Select existing class and ask:// "Add the email verification method based on Tomba API docs"export class TombaClient { // existing code... // Claude will add the method here}
Step 3: Error handling
Code
@file:src/client/tomba.ts @docsAdd comprehensive error handling to this Tomba client including:- Network errors- API errors with status codes- Rate limit handling- Timeout handling- Custom error types
@docs @file:middleware/validation.jsComplete this Express middleware to use Tomba email verification:- Extract email from request body- Call Tomba verification API- Add verification result to request object- Handle errors appropriately- Respect rate limits
Code Examples & Patterns
1. Async/Await Pattern
Prompt:
Code
@docs Create an async function for Tomba email verification with:- Proper TypeScript types- Error handling with try/catch- Timeout handling- Retry logic for failed requests
Generated Code:
Code
import axios, { AxiosResponse } from "axios";interface TombaVerificationResult { email: string; result: "valid" | "invalid" | "unknown"; score: number; reason: string; // ... other fields from API docs}interface TombaApiError { error: string; message: string; status: number;}class TombaClient { private apiKey: string; private secretKey: string; private baseUrl = "https://api.tomba.io/v1"; constructor(apiKey: string, secretKey: string) { this.apiKey = apiKey; this.secretKey = secretKey; } async verifyEmail( email: string, options: { timeout?: number; retries?: number } = {}, ): Promise<TombaVerificationResult> { const { timeout = 30000, retries = 3 } = options; for (let attempt = 1; attempt <= retries; attempt++) { try { const response: AxiosResponse<TombaVerificationResult> = await axios.get(`${this.baseUrl}/email-verifier`, { params: { email }, headers: { "X-Tomba-Key": this.apiKey, "X-Tomba-Secret": this.secretKey, }, timeout, }); return response.data; } catch (error) { if (axios.isAxiosError(error)) { const apiError = error.response?.data as TombaApiError; // Don't retry on client errors if (error.response?.status && error.response.status < 500) { throw new Error( `Tomba API error: ${apiError?.message || error.message}`, ); } // Retry on server errors if (attempt === retries) { throw new Error( `Tomba API failed after ${retries} attempts: ${error.message}`, ); } // Wait before retry (exponential backoff) await new Promise((resolve) => setTimeout(resolve, Math.pow(2, attempt) * 1000), ); } else { throw error; } } } throw new Error("Unexpected error in email verification"); }}
2. React Hook Pattern
Prompt:
Code
@docs Create a React hook for Tomba email verification with:- Loading states- Error handling- Caching with React Query- TypeScript support
3. Node.js Service Pattern
Prompt:
Code
@docs Create a Node.js service class for Tomba operations with:- Connection pooling- Rate limiting- Caching with Redis- Comprehensive logging- Health checks
Advanced Features
1. Code Generation from Selection
Select existing code and enhance it:
Code
// Select this basic functionasync function processEmails(emails: string[]) { return emails.map((email) => ({ email, valid: true }));}// Ask: "Enhance this with Tomba bulk verification using the API documentation"
@file:src/services/tomba.ts @docsGenerate comprehensive Jest tests for this Tomba service including:- Unit tests for all methods- Mock API responses- Error scenario testing- Rate limit testing- Integration tests
Best Practices
1. Structured Prompts
Use clear, specific prompts:
Code
Context: Building user registration systemTask: Integrate Tomba email verificationRequirements:- Real-time validation during form input- Fallback for API failures- User-friendly error messages- TypeScript throughout@docs Please implement email verification for my registration form