Install
Install with your coding agent
Give Codex or Claude Code the ABTO SDK knowledge it needs to inspect your app, select the right SDKs, install them, and verify the connection.
Run once in your terminal
npx --yes skills@latest add https://github.com/greedy-co/abto-sdk/tree/main/abto --skill abto --global --agent codex --copy --yesThen verify
npx --yes skills@latest list --global --agent codexExpected directory
~/.agents/skills/abtoWhat changes after installation?
- Once the Skill is installed, use
/abtoin your coding agent to open ABTO integration instructions. - Ask your agent to integrate ABTO, and it will show you where to initialize the SDK and add events.
- Choose only the points you want, then let the agent implement the event code for an easier integration.
Installation troubleshooting
Requires Node.js 22.20 or later. If mise reports that no version is set for the npx shim, inspect `mise current node` and activate a compatible installed version with `mise use`.
1. Route your LLM calls
Send LLM traffic through the ABTO gateway so cost and latency are captured at the source. Use your ck-abto-live-a7f3… key (server-side).
npm install @abto-app/calling openaiimport type OpenAI from 'openai';
import { initAbto } from '@abto-app/calling';
const abto = initAbto({
abtoApiKey: process.env.ABTO_CALLING_KEY,
gatewayBaseURL: 'https://gateway.abto.app/v1',
providerKeys: {
openai: process.env.OPENAI_API_KEY,
gemini: process.env.GEMINI_API_KEY,
anthropic: process.env.ANTHROPIC_API_KEY,
},
environment: 'production',
});
const { data: completion, response } = await abto.withContext(
{
deviceId: 'device-abc',
featureId: 'review.summary',
},
async () => {
const openai = await abto.openai<OpenAI>();
return openai.chat.completions
.create({
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: '이 상품의 리뷰 12개를 세 줄로 요약해 줘.' }],
})
.withResponse();
},
);
const requestId = response.headers.get('x-abto-request-id');2. Track user outcomes
Capture conversions (signup, purchase, thumbs-up…) in your browser or mobile app. Use the same deviceId as your backend to connect product events with AI calls; individual responses use requestId. It uses your ek-abto-… key, which is safe to ship in client bundles.
npm install @abto-app/eventInitialize once in your app, replace the Event Key placeholder, and call capture when the outcome occurs.
import { defineEvents, initAbto } from '@abto-app/event';
const events = defineEvents({
checkout_completed: { description: '결제 완료' },
});
export const abto = initAbto({
projectKey: 'ek-abto-...',
apiHost: 'https://api.abto.app',
environment: 'production',
events,
});
abto.capture('checkout_completed', {
value: 49000,
scale: 'KRW',
});