Skip to main content
The Odin AI SDK (Software Development Kit) provides a comprehensive TypeScript/JavaScript library for integrating Odin AI’s powerful features into your applications. Build chat interfaces, manage structured data, enable voice conversations, and leverage AI agents programmatically. This article will give you an overview of the Odin AI SDK with some use case examples and best practices.

What is the Odin AI SDK?

The Odin AI SDK is a TypeScript library that provides programmatic access to Odin AI’s core features:
  • ChatSDK: Build conversational AI interfaces with chat management, message handling, and streaming responses.
  • SmartTablesSDK: Manage structured data tables with advanced querying, filtering, and AI-powered data processing.
  • VoiceSDK: Enable voice conversations with automatic chat integration and React hooks.

Installation

Or with yarn:

Quick Start

Basic Setup

Authentication

The SDK supports two authentication methods: Use API keys for server-to-server communication and external integrations:
Getting API Keys:
  1. Navigate to My Account > API Keys in your Odin AI dashboard
  2. Create a new API key pair
  3. Copy the API Key and API Secret
  4. Store them securely (use environment variables, never commit to version control)

2. Access Token Authentication (For Web Apps)

Use access tokens for client-side applications with existing user sessions:

SDK Components

Chat SDK

Build conversational AI interfaces with comprehensive chat management. Key Features:
  • Create, list, and manage chats
  • Send messages with streaming support
  • Knowledge base integration
  • File uploads (images, documents)
  • User feedback (thumbs up/down)
  • Custom agents and models
Learn More: Chat SDK Documentation

Smart Tables SDK

Manage structured data with advanced querying and AI-powered processing. Key Features:
  • Create and manage data tables
  • Advanced filtering and sorting
  • Data import/export (CSV, Excel)
  • AI-powered column computation
  • Custom views and column management
  • Pagination and search
Learn More: Smart Tables SDK Documentation

Voice SDK

Enable voice conversations with automatic chat integration. Key Features:
  • Real-time voice conversations
  • Automatic transcription
  • React hooks for easy integration
  • Audio visualization
  • Session management
  • Chat integration
Learn More: Voice SDK Documentation

Common Use Cases

1. Customer Support Chatbot

2. Data Management Application

3. Voice-Enabled Application

Environment Variables

For production applications, always use environment variables:

Error Handling

All SDK methods throw errors that should be caught and handled:

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

React Integration

The SDK includes React hooks for easy integration:

Best Practices

1. Use Environment Variables

Never hardcode API keys or secrets in your code. Always use environment variables.

2. Handle Errors Gracefully

Always wrap SDK calls in try-catch blocks and provide meaningful error messages to users.

3. Reuse SDK Instances

Create SDK instances once and reuse them rather than creating new instances for each operation.

4. Use Streaming for Better UX

For chat applications, use streaming responses for real-time feedback:

5. Implement Pagination

When listing chats or querying tables, always implement pagination:

Getting Help

  • Documentation: Browse the detailed documentation for each SDK component.
  • Support: Email Support for technical assistance.
  • Examples: Check the SDK repository for complete working examples.