Quickstart: JavaScript / TypeScript
Works with LangChain.js in Node 18+ and Next.js (server side). Same ingest contract and dashboard as the Python SDK.
1. Install
npm install vorlo-trace2. Get an API key
Create one in your Vorlo account under Settings → API keys:
export VORLO_API_KEY="vrlo_..."3. Add two lines to your agent
import * as vorlo from 'vorlo-trace';
// 1 — initialize once at startup
vorlo.init({ agentName: 'order-agent' }); // reads VORLO_API_KEY
// 2 — pass the handler wherever your agent runs
const result = await agentExecutor.invoke(
{ input: 'Process the refund for order #1234' },
{ callbacks: [vorlo.getHandler()] },
);Or use the convenience wrapper
const out = await vorlo.trace(agentExecutor, { input: 'Process the refund' });Redacting sensitive data
vorlo.init({
agentName: 'order-agent',
redact: (text) => text.replace(/[\w.+-]+@[\w-]+\.[\w.]+/g, '[EMAIL]'),
});The callback runs on every captured string before it leaves your process. If it throws, the content is dropped rather than shipped raw.
Notes for Next.js
- Initialize and run agents on the server (route handlers, server actions) — the SDK uses Node APIs and your API key must never reach the browser.
- Sends are non-blocking
fetchcalls with a bounded in-flight queue; serverless cold starts and short-lived functions are fine. - Set
VORLO_DEBUG=1to log send activity while integrating.