BricqsBricqs

Getting started with gamification

Three integration paths, one decision. Pick the one that matches the surface you are integrating into. Most production stacks combine the SDK and the REST API; the iframe path is the fast lane for marketing-led campaigns. This page covers the decision and ships a working quickstart for all three.

Last updatedMay 2026

Key takeaways

Quick read
  • Headless SDK is the default for React and Next.js. Hooks render points, tier, badges, streaks, challenges, leaderboards, and rewards in your own UI.
  • REST API is the default for everything else: native mobile, server-to-server, partner platforms, non-React frontends (Vue, Svelte, server-rendered).
  • iframe a Bricqs-hosted engagement page when speed beats UI control — marketing-led campaigns, microsites, partner placements.
  • Switching paths does not lose data. Participant ledger, points, badges, streaks, and challenge progress are stored once and visible to every surface.

The decision

Which path is right

PathBest forUI control
Headless SDKReact or Next.js apps where you own the UI. Onboarding flows, in-app challenges, member dashboards.Full
REST APINative mobile (iOS, Android), server-to-server scoring, partner platforms, non-React web (Vue, Svelte, server-rendered).Full
iframe pageMarketing-led campaigns, microsites, partner placements where Bricqs renders the engagement page.Pre-built
Default rule:SDK for React product surfaces. REST API for everything else. iframe when the marketing team wants to ship without engineering.

Headless SDK

Quickstart for React

Three steps from zero to a working points display.

bash
npm install @bricqs/headless-react
app/providers.tsx·tsx
"use client";
import { BricqsProvider } from "@bricqs/headless-react";

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <BricqsProvider
      tenantId={process.env.NEXT_PUBLIC_BRICQS_TENANT!}
      participantToken={getParticipantTokenFromCookie()}
      env="production"
    >
      {children}
    </BricqsProvider>
  );
}
app/components/PointsBadge.tsx·tsx
"use client";
import { usePoints } from "@bricqs/headless-react";

export function PointsBadge() {
  const { available, lifetime, isLoading } = usePoints();
  if (isLoading) return <span>Loading...</span>;
  return (
    <span className="inline-flex items-center gap-2">
      <strong>{available.toLocaleString()}</strong> pts
      <small>(lifetime {lifetime.toLocaleString()})</small>
    </span>
  );
}

REST API

Quickstart for any backend

Two steps: send an event, read state.

POST one event·bash
curl -X POST https://api.bricqs.co/api/v1/ingest/events \
  -H "Authorization: Bearer bq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "participant_id": "p_8a3f",
    "event_type": "purchase_completed",
    "attributes": { "amount": 1250, "currency": "INR" },
    "idempotency_key": "p_8a3f:order_4271"
  }'
GET participant state·bash
curl https://api.bricqs.co/api/v1/gamify/state/p_8a3f \
  -H "Authorization: Bearer bq_live_..."

# response
{
  "participant_id": "p_8a3f",
  "points": { "available": 1250, "lifetime": 4820 },
  "tier": { "id": "silver", "label": "Silver" },
  "streaks": [...],
  "active_challenges": [...]
}

iframe page

Quickstart for iframing a Bricqs-hosted engagement

When the marketing team wants to ship a campaign page without engineering, embed a Bricqs-hosted engagement (quiz, spin, scratch, challenge surface) via iframe. You pass the participant id; Bricqs handles UI, event submission, and reward delivery.

campaign.html·html
<iframe
  src="https://run.bricqs.co/e/your-engagement-slug?participant=p_8a3f"
  width="100%"
  height="640"
  frameborder="0"
  allow="clipboard-write"
></iframe>

The engagement is configured in the Bricqs dashboard. Participation, points, and rewards still hit the same ledger as the SDK and REST paths — so a user who completes the iframe campaign on Monday and logs into your app on Tuesday sees the points they earned.

Where to go next

Pick the next page based on your path

Developer FAQ

Common questions when integrating gamification with Bricqs.

Ready to ship?

Wire it up with the Bricqs SDK or API

Headless SDK for React UIs, REST API for any backend. Same engine behind both.

1 brief to align the room2 mechanics max in version one
What happens next
01
Pick the mechanic
Choose the smallest working system for the brief.
02
Launch without rebuilds
Configure rules and rewards in one place.