Skip to Content
The AKIN Travel developer platform is in beta — APIs may change. Get started →
Quickstart

Quickstart

Go from “no AKIN Travel account” to your first authenticated API call in under ten minutes — in whatever stack you’re building on.

1. Get partner access

Your AKIN Travel onboarding contact provisions you with:

CredentialPurpose
Partner IDIdentifies your partner in the AKIN Travel system
API keyPublishable pk_test_* (sandbox) / pk_live_* (production) for the browser; secret sk_test_* / sk_live_* for your server only (key classes) — partner identification + API access
GraphQL endpointhttps://sandbox.akintravel.com/graphql (sandbox) / https://api.akintravel.com/graphql (production)
Firebase / GIP configWeb/Android/iOS Firebase config used to exchange the custom token for an ID token

Use a *_test_* key (pk_test_* or sk_test_*) against the sandbox endpoint for local dev and CI; only switch to the matching *_live_* key + production in release builds.

2. Understand the auth exchange

Every authenticated request carries a Firebase ID token as a bearer header. You obtain one in three steps — the same on every platform:

  1. Request a magic link — call the requestMagicLink mutation (or use the SDK’s <MagicLinkForm>). The member receives an email; the link returns them to your redirectUrl with a one-time token.
  2. Verify the token — call verifyAuthToken(token); it returns a short-lived Firebase customToken (plus the member’s profile).
  3. Exchange for an ID token — pass the customToken to Firebase Auth’s signInWithCustomToken. Firebase has native web, Android, and iOS SDKs, so this step works everywhere. The resulting ID token goes in Authorization: Bearer <idToken> on each GraphQL request, and Firebase refreshes it for you.

The React SDK does all three behind <AkinProvider>; every other stack wires them with a GraphQL client + the Firebase Auth SDK.

3. Build it on your stack

npm install @akin-travel/partner-sdk

The SDK has React 18+/19 and React-DOM as peer dependencies; Next.js 15 and 16 are both supported.

// app/layout.tsx — wrap once import { AkinProvider, resolveConfig } from '@akin-travel/partner-sdk'; export default function RootLayout({ children }) { return ( <AkinProvider config={resolveConfig({ partnerId: process.env.NEXT_PUBLIC_AKIN_PARTNER_ID!, // Use a PUBLISHABLE (browser-safe) key here — this ships to the browser. // pk_test_* → sandbox, pk_live_* → production. Never an sk_* secret key. apiKey: process.env.NEXT_PUBLIC_AKIN_API_KEY!, // 'staging' targets the sandbox endpoint; omit it for production. environment: 'staging', verifyCallbackUrl: 'https://yourapp.com/auth/verify', // Required for sign-in: the Firebase / GIP config from onboarding. The // SDK has no default for it and reads no environment variables. firebase: { apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY!, authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN!, projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID!, appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID!, }, gipTenantId: process.env.NEXT_PUBLIC_GIP_TENANT_ID!, })} > {children} </AkinProvider> ); }

This key ships to the browser, so it must be a publishable (browser-safe) key — read-only by construction. Server-to-server writes (enrolment, points) use a secret key on your backend. See publishable vs secret keys.

// Sign a member in, then read their loyalty state import { MagicLinkForm, useAkinAuth, useAkinLoyalty } from '@akin-travel/partner-sdk'; export function Account() { const { member } = useAkinAuth(); const { points, tier } = useAkinLoyalty(); if (!member) { return ( <MagicLinkForm onSuccess={(m) => console.log('Signed in:', m.id)}> {({ email, setEmail, handleSubmit, isPending }) => ( <form onSubmit={handleSubmit}> <input value={email} onChange={(e) => setEmail(e.target.value)} placeholder="you@example.com" /> <button type="submit" disabled={isPending}>{isPending ? 'Sending…' : 'Send magic link'}</button> </form> )} </MagicLinkForm> ); } return <span>{member.firstName} • {points} pts • {tier}</span>; }

resolveConfig picks the GraphQL endpoint from environment (production when you leave it out, https://api.akintravel.com/graphql); pass apiUrl only to override it. The firebase block and gipTenantId are required for member sign-in, and the SDK reads no environment variables of its own, so name your env vars as you like. The provider handles the magic-link → verifyAuthToken → signInWithCustomToken exchange and attaches the bearer token to every request.

Next steps

  • Read Authentication for the full flow: passkeys, custom-token exchange, and session refresh.
  • See Using the API for the endpoint contract, headers, and error shape (any language).
  • Browse the GraphQL reference for every partner-scoped type and field.
  • On React? The SDK reference lists every export.
Last updated on