Installation
Install the AI Inbx TypeScript SDK using your preferred package manager:Quick Start
Initialize the client with your API key:Built-in Helpers
1. Next.js webhook handler
createNextRouteHandler() generates a ready-to-use POST handler that:
- Validates the request signature using the
AI_INBX_SECRETenv variable. - Parses the webhook payload and routes it to the correct callback.
Handler parameters
2. LLM-friendly formatting
UseemailToLLMString() and threadToLLMString() to transform rich email objects into compact, XML-ish strings optimised for Large Language Models:
- Keep only fields relevant for reasoning (addresses, subject, text, etc.).
- Preserve structure with lightweight XML-like tags.
- Return a single string ready to drop into your prompts.
Full example: AI-powered support bot
app/api/aiinbx-webhook/route.ts
ℹ️ The example above is completely serverless and needs no additional infrastructure.
Complete Documentation
For comprehensive documentation including:- Request & response types
- Error handling
- Advanced configuration
- All available methods
- TypeScript examples