Skip to main content

Installation

Install the SDK using your preferred package manager:
npm install jasni-sdk

Quick Start

import { Jasni } from 'jasni-sdk'

// Initialize the client with your API key
const jasni = new Jasni('jsk_your_api_key')

// List your agent's inboxes
const { accounts } = await jasni.accounts.list()
console.log(accounts)

// Let your agent send an email
const result = await jasni.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Your request has been processed',
  text: 'I have completed the task you requested. Here are the results...',
})
console.log('Agent sent email:', result.messageId)

Configuration

The SDK accepts optional configuration parameters:
const jasni = new Jasni('jsk_your_api_key', {
  baseUrl: 'https://api.jasni.ai', // Optional: custom base URL
})

Configuration Options

OptionTypeDefaultDescription
baseUrlstringhttps://api.jasni.aiAPI base URL

Available Resources

The Jasni client provides access to the following resources:

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. Import types as needed:
import type { 
  Email, 
  Account, 
  Label, 
  Webhook,
  SendEmailOptions,
  ListEmailsOptions,
  Draft,
  EmailPreview,
} from 'jasni-sdk'

Requirements

  • Node.js 18 or higher
  • TypeScript 4.7+ (for TypeScript users)

Next Steps