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:
| Credential | Purpose |
|---|---|
| Partner ID | Identifies your partner in the AKIN Travel system |
| API key | pk_test_* (sandbox) and pk_live_* (production) — partner identification + API access |
| GraphQL endpoint | https://staging-api.akintravel.com/graphql (sandbox) / https://api.akintravel.com/graphql (production) |
| Firebase / GIP config | Web/Android/iOS Firebase config used to exchange the custom token for an ID token |
Use the pk_test_* key against the sandbox endpoint for local dev and CI; only switch to pk_live_* + 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:
- Request a magic link — call the
requestMagicLinkmutation (or use the SDK’s<MagicLinkForm>). The member receives an email; the link returns them to yourredirectUrlwith a one-timetoken. - Verify the token — call
verifyAuthToken(token); it returns a short-lived FirebasecustomToken(plus the member’s profile). - Exchange for an ID token — pass the
customTokento Firebase Auth’ssignInWithCustomToken. Firebase has native web, Android, and iOS SDKs, so this step works everywhere. The resulting ID token goes inAuthorization: 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
React
npm install @akin-travel/partner-sdkThe 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.
apiKey: process.env.NEXT_PUBLIC_AKIN_API_KEY!,
})}
>
{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 selects the right endpoints from the API key prefix; 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.