Installation

Requirements

  • Node.js 14.x or higher
  • npm or yarn package manager

Installing the SDK

Install the Truffle AI SDK using npm:

npm install truffle-ai

Or using yarn:

yarn add truffle-ai

Configuration

Import and initialize the TruffleAI client in your code:

import { TruffleAI } from 'truffle-ai';

const truffle = new TruffleAI('your-api-key');

The client accepts an optional configuration object:

const truffle = new TruffleAI('your-api-key', {
  baseUrl: 'https://custom-api-url.com' // Optional: Override the default API URL
});

TypeScript Support

The SDK is written in TypeScript and includes type definitions out of the box. No additional configuration is required to use it in a TypeScript project.

Next Steps

Once you have installed the SDK, you can: