Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rako.sh/llms.txt

Use this file to discover all available pages before exploring further.

JavaScript / TypeScript SDK

Use the JavaScript SDK when you want full control from Node.js, Deno, or Bun.
Install
npm install @rakohq/sdk
quickstart.ts
import { AAP } from '@rakohq/sdk';

const aap = new AAP({ apiKey: 'your-api-key' });

// 1. Search for offers
const { offers, sessionId } = await aap.search({
  vertical: 'sim',
  maxPrice: 10,
  contractMonths: 0,
});

// 2. Recommend an offer (records attribution)
const rec = await aap.recommend({
  sessionId,
  offerId: offers[0].id,
  context: 'User asked for cheap SIM with no contract',
});

// 3. Initiate checkout
const checkout = await aap.checkout({
  sessionId,
  recommendationId: rec.recommendationId,
});

Client

new AAP(config)

OptionTypeRequiredDefault
apiKeystringYes
baseUrlstringNohttps://api.rako.sh

Methods

aap.search(options)

Returns matching offers and a session ID.
OptionTypeDescription
verticalstringsim, broadband, energy, flights, hotels, insurance
providerstringFilter by provider name
maxPricenumberMaximum price
minDataGbnumberMinimum data allowance for SIM offers
contractMonthsnumberContract length, where 0 means rolling

aap.recommend(options)

Record a recommendation. This is the attribution event.
OptionTypeDescription
sessionIdstringSession from search()
offerIdstringOffer to recommend
contextstringWhy this offer was recommended

aap.checkout(options)

Initiate checkout for a recommended offer.
OptionTypeDescription
sessionIdstringSession from search()
recommendationIdstringRecommendation from recommend()
userDetailsobjectOptional user details for checkout

aap.getSession(sessionId)

Get session details including recommendations and conversions.

aap.verifyCode(code)

Verify an AAP Code is authentic.

npm

GitHub