BricqsBricqs
Developer guides

Build gamification with Bricqs

The complete developer guide for shipping points, tiers, badges, challenges, contests, streaks, leaderboards, rewards, and referrals. Pick an integration path, copy a working pattern, push to production. Headless React SDK, REST API, embed widgets — same engine behind all three.

AudienceEngineers and tech leads
StacksReact, Next.js, Node, Python, mobile
Last updatedMay 2026
Looking for non-technical guides? See the main guides library

Key takeaways

Quick read
  • Three integration paths: headless React SDK (11 typed hooks), REST API (45 endpoints across /gamify and /ingest), and iframe embed.
  • Server-side scoring is non-negotiable. Client state is gamed within hours of release. Points, contests, and rewards always reconcile against the Postgres ledger.
  • Idempotency keys on every write. Retries must never double-credit — points, contest entries, and reward claims all enforce uniqueness at the database level.
  • API keys are tenant-scoped, with separate participant and admin scopes. Mint short-lived participant tokens server-side; never ship admin keys to the browser.
  • Webhooks deliver outbound events with HMAC-SHA256 signing and exponential-backoff retry. Verify the signature header before acting on any webhook body.

Integration paths

Three ways to ship gamification

Pick the path that matches the surface you are integrating into. Most production builds use two of the three over time — SDK for member-facing UI, API for server-side scoring and admin tooling.

Headless React SDK

11 typed React hooks for points, tier, badges, streaks, challenges, leaderboards, rewards, referrals, engagement components. Zero JSX, you own the UI. Best when your design team controls the surface.

REST API

45 endpoints across /gamify (participant + admin) and /ingest (events). Idempotent writes, append-only ledger, anti-fraud built in. Best for native mobile, server-to-server, and partner platforms.

Iframe and embed

Drop-in widgets for quizzes, spins, scratches, challenge surfaces, and contest leaderboards. Pre-built UI. Best when shipping speed matters more than pixel-perfect control.

End-to-end example

See every primitive compose into one product

Reading a single SDK or API page tells you how one hook works. The example below shows how nine mechanics compose — onboarding coins, daily activity, streaks, follower milestones, weekly leaderboards, badges, season rewards, webhooks, and referrals — wired end-to-end on a real product surface. If your stack maps to this page, the engine will handle it.

Proof of stack · 20 min read

Esports social network on Bricqs

A complete walkthrough for “Qlan.gg” — a hypothetical gamer social network. Onboarding coins, daily activity loop, login streak with freezes, follower milestones, weekly Valorant/Apex/BGMI leaderboards, badge catalog, season-tier rewards driven by webhook fulfilment, weekly challenges, and squad referrals. Every API call, every SDK hook, every UI component shown.

Read the walkthrough →

Coins

Streaks

Badges

Leaderboards

Challenges

Milestones

Rewards

Webhooks

Referrals

Compare the paths

SDK vs REST API vs Embed

A side-by-side comparison so you can pick the right path the first time.

CapabilityHeadless SDKREST APIEmbed
StackReact 18+, Next.js, Vite, RemixAny HTTP-capable backend or mobileAny page that can host an iframe
UI controlFull — you render everythingFull — you render everythingPre-built, theme-able
Server-side scoringVia REST under the hoodDirectDirect
Best forMember-facing UI inside an appMobile, server-to-server, partner APIsMarketing campaigns, microsites
Auth modelShort-lived participant tokensAPI key + optional participant tokenPublic widget key + URL params
TypeScript typesShipped in the SDKOpenAPI spec at /docsN/A
Default rule:All three paths hit the same Bricqs engine. Mix and match as your product evolves.

By stack

Choose the SDK path that matches your stack

Stack-specific starting points so you skip the setup decisions and go straight to the first hook or endpoint.

React + Next.js (App Router)

Install @bricqs/headless-react. Mint participant tokens in a Route Handler. Wrap the app in BricqsProvider once. usePoints, useTier, useChallenge render in any Client Component. SSR-safe via passed-in token prop.

Vite, Remix, Astro

Same package. The Provider lives at the root of the client island. Use the same hook surface; the SDK does not depend on Next.js APIs.

Node, Python, Go (server)

Call /api/v1/gamify directly. Bricqs ships an OpenAPI spec at /docs, so generated clients are one command away. Use Idempotency-Key on every write.

iOS / Android

REST API via a thin native client. Sample Swift (URLSession) and Kotlin (Retrofit) wrappers in /guides/build/api/auth-and-keys. Mint participant tokens server-side, refresh before TTL.

Server-to-server / partner

Webhooks for outbound; REST API for inbound. HMAC-SHA256 signing on every webhook. Exponential backoff with up to 12 retries over 24 hours.

No-code / marketing-led

Iframe embed with URL-param theming, or the canvas builder for full visual control. No engineering required; analytics and rewards still hit the same ledger.

The library

Every developer guide, in one place

The cluster below mirrors the marketing IA. Every marketing guide has at least one paired developer guide — pick by goal, by primitive, or by surface.

What you get from the engine

Production guarantees, not just an API

What Bricqs handles so you do not have to.

Idempotency on every write

Idempotency-Key header on points, contests, rewards, events. (participant_id, source_fact_id) is a database-level unique constraint. Retries never double-credit.

Append-only ledger

Points and contest scoring use an append-only event log. Reconcile, rebuild, and audit without ever mutating history. Snapshot tables for fast reads.

Server-side anti-fraud

Velocity checks per-minute, per-hour, per-day. Suspicious rank-jump detection. Auto-disqualification before prize allocation. Built into the contest scoring path.

Observability built in

Structured logs, OpenTelemetry tracing, Prometheus metrics. Every fact, every score event, every webhook delivery is traceable end-to-end.

Rate limits and back-pressure

1,000 req/min per key, 5,000/min per tenant, 100/sec burst. Redis sorted-set sliding window. Event ingestion buffers via Redis Streams under load.

Tenant isolation

Every row, every key, every ledger entry is tenant-scoped. Postgres row-level security enforced. Multi-tenant safe by default.

Developer FAQ

Common questions when integrating gamification with Bricqs.

Ready to ship?

Build with Bricqs

Headless SDK for React UIs. REST API for any backend. Embed widgets when speed beats UI control. Same engine, three surfaces.

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.