Skip to main content

TypeScript SDK Coming Soon

We’re actively developing the Switchport TypeScript/JavaScript SDK to bring the same powerful prompt management and A/B testing capabilities to Node.js and browser environments.

Expected Features

The TypeScript SDK will include:

Full Type Safety

Built with TypeScript for excellent IDE support and type safety

Promise-based API

Async/await support for modern JavaScript development

Same Core Features

Prompt execution, metrics tracking, and A/B testing just like Python SDK

Browser Support

Works in both Node.js and browser environments

Planned API

The API will be similar to the Python SDK for consistency:
import { Switchport } from '@switchport/sdk';

// Initialize client
const client = new Switchport({
  apiKey: process.env.SWITCHPORT_API_KEY
});

// Execute a prompt
const response = await client.prompts.execute({
  promptKey: 'welcome-message',
  user: { userId: 'user_123' },
  variables: { name: 'Alice' }
});

console.log(response.text);

// Record a metric
await client.metrics.record({
  metricKey: 'satisfaction',
  value: 4.5,
  user: { userId: 'user_123' }
});

Stay Updated

Want to be notified when the TypeScript SDK is released?

GitHub

Star our repo to get updates

Discord

Join our community

Twitter

Follow for announcements

In the Meantime

While you wait for the TypeScript SDK, you can:

Use the Python SDK

If you have a Python backend, you can use the Python SDK today:

Python SDK Quickstart

Get started with the Python SDK in 5 minutes

Use the REST API Directly

You can call the Switchport API directly from TypeScript:
// Example: Execute a prompt via REST API
async function executePrompt(promptKey: string, variables: Record<string, any>) {
  const response = await fetch('https://switchport-api.vercel.app/api/sdk/v1/prompts/execute', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.SWITCHPORT_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      prompt_key: promptKey,
      variables,
      user: {}
    })
  });

  const data = await response.json();
  return data.text;
}

// Usage
const text = await executePrompt('welcome-message', { name: 'Alice' });
console.log(text);

REST API Reference

View the complete REST API documentation

Contributing

Interested in contributing to the TypeScript SDK development? We welcome contributions! Here’s how you can help:
1

Join our Discord

Connect with the team and other contributors in our Discord community
2

Check GitHub issues

Look for issues tagged with typescript-sdk or help-wanted
3

Share feedback

Let us know what features are most important for your use case

GitHub Repository

Contribute to the Switchport SDKs

SDK Roadmap

Our SDK development roadmap:
  • Python SDK - Available now
  • 🚧 TypeScript SDK - In development
  • 📋 Go SDK - Planned
  • 📋 Ruby SDK - Planned
  • 📋 PHP SDK - Planned

Questions?

Have questions about the TypeScript SDK or want to request specific features?

Discord Community

Ask questions and share ideas

Email Support

Contact our support team