📦 Client SDK
The Noxivo Engine provides a type-safe client for Node.js/TypeScript environments.
Installation
- npm
- Yarn
- pnpm
npm install @noxivo/messaging-client
yarn add @noxivo/messaging-client
pnpm add @noxivo/messaging-client
Usage
Importing the Client
import { MessagingSessionService } from '@noxivo/messaging-client';
// The client is designed to work with the Engine's proxy
const engineBaseUrl = 'https://api-workflow-engine.noxivo.app/api/v1';
const engineApiKey = 'your-engine-api-key';
// Example: Sending a message using the proxy
async function sendMessage(sessionName: string, chatId: string, text: string) {
const response = await fetch(`${engineBaseUrl}/sendText`, {
method: 'POST',
headers: {
'API-Key': engineApiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
session: sessionName,
chatId: chatId,
text: text
})
});
return response.json();
}
Shared Contracts
You can also use our shared Zod schemas and TypeScript types:
- npm
- Yarn
- pnpm
npm install @noxivo/contracts
yarn add @noxivo/contracts
pnpm add @noxivo/contracts
import { SendMessageSchema } from '@noxivo/contracts';