Skip to main content

Installation

The Sudo SDK is available for both Python and TypeScript/JavaScript. Choose your preferred language and package manager below.
Python: Requires Python 3.9 or later
TypeScript/JavaScript: Requires Node.js 14+ and supports both CommonJS and ES Modules

Authentication

The SDK uses API key authentication. You can obtain your API key from the Sudo Developer Portal. Set your API key as an environment variable:
TypeScript

Direct Configuration

Alternatively, you can pass the API key directly:
TypeScript
Never hardcode your API key in your source code, especially in code that will be committed to version control. Always use environment variables or secure configuration management.

Basic Configuration

Server URL

By default, the SDK points to the production Sudo API. You can customize this:
TypeScript

Retry Configuration

Configure retry behavior for failed requests:
TypeScript

Custom HTTP Client

For advanced use cases, you can provide a custom HTTP client:
TypeScript

Async Support

Both SDKs support asynchronous operations:

Async/Await

TypeScript

Synchronous Usage (Python Only)

Error Handling

Both SDKs provide comprehensive error handling:
TypeScript

Debugging

Enable debug logging to troubleshoot issues:

Using Environment Variable

Language-Specific Debug Configuration

TypeScript

IDE Support

VS Code

Both SDKs work well with VS Code out of the box. For enhanced type checking: TypeScript:
Python:

Other IDEs

PyCharm (Python): WebStorm (TypeScript):
  • TypeScript support is built-in
  • Enable TypeScript language service

Next Steps

Now that you have the SDK installed and configured:
  1. Try System Endpoints - Test your setup with health checks
  2. Create AI Responses - Start building AI-powered features
  3. Explore Streaming - Add real-time capabilities
Both SDKs follow semantic versioning. Pin to a specific version in production to ensure stability:Python:
TypeScript: