Quick Start

This guide will walk you through integrating Octavus into your application in under 10 minutes.

Prerequisites

  • Node.js 18+
  • An Octavus account with API key
  • A Next.js application (or any Node.js backend)

Installation

Install the Octavus SDKs in your project:

bash

Backend Setup

1. Initialize the Client

Create an Octavus client instance in your backend:

typescript

2. Create a Session Endpoint

Create an API endpoint that creates sessions and returns the session ID:

typescript

3. Create a Trigger Endpoint

Create an endpoint that handles triggers and streams responses:

typescript

Frontend Setup

1. Create a Chat Component

Use the useOctavusChat hook with the HTTP transport:

tsx

2. Create Session and Render Chat

tsx

Environment Variables

Add these to your .env.local:

bash

What's Next?

Now that you have a basic integration working: