Enterprise Headless Leaderboards
Zero-iframe, headless gamification and ranking infrastructure. Embed live, high-performance community rankings and podiums directly into your native web applications.
The Thrico Enterprise Leaderboard Platform is a zero-iframe, headless gamification and ranking infrastructure. It allows enterprise clients (such as financial institutions, fintech platforms, loyalty programs, and web portals) to embed live, high-performance community rankings, custom podiums, and badge tiers directly into their native HTML, React, Next.js, Angular, or Vue web applications.
📑 Table of Contents
- Architectural Overview
- Why Headless (Zero Iframes)?
- Dashboard Configuration & Settings
- Quick Start (HTML CDN Integration)
- Connecting Members & User Identity (Email & User ID)
- Authentication & Domain Whitelisting
- JavaScript / TypeScript SDK Reference
- Direct REST API Reference (Headless & Mobile Apps)
- Data Contracts & Models
- Media & Image CDN Standards
- End-to-End Implementation Example
- Production Best Practices & Troubleshooting
1. Architectural Overview
Key Performance Guarantees:
- Zero Iframes: Integrated directly into your DOM. You maintain 100% control over CSS, typography, responsive breakpoints, and animations.
- Sub-10ms Latency: Leaderboard ranks are indexed in high-performance Redis Sorted Sets (ZSET).
- Deterministic Ranking: Microsecond-precision tie-breaking guarantees no two members share a rank position.
- Ephemerality & Security: Ephemeral, origin-bound JWTs ensure secret keys are never exposed in client-side code.
2. Why Headless (Zero Iframes)?
Traditional iframe embeds suffer from major enterprise limitations:
- ❌ Inconsistent Styling: Impossible to seamlessly match enterprise design systems and corporate brand guidelines.
- ❌ Poor Mobile Responsiveness: Inner iframe scrollbars, viewport clipping, and broken touch gestures.
- ❌ SEO & Accessibility: Invisible to search crawlers, difficult for screen reader workflows.
- ❌ Security Restrictions: Blocked by third-party cookie restrictions, partitioned storage, and strict
X-Frame-Options.
Thrico's Headless Approach provides pure data delivery via a lightweight CDN JavaScript SDK or raw JSON endpoints. You render standard HTML elements (<div>, <table>, <img>) styled with your own CSS or UI design system.
3. Dashboard Configuration & Settings
Enterprise administrators manage API keys, allowed domains, and embed configurations directly in the Thrico Admin Portal.
Dashboard URL: Navigate to Gamification → Points & Badges → Settings → Leaderboard
Direct Path: /gamification/points-and-badges/settings/leaderboard
Available Hub Tabs:
- Leaderboards: View, configure, and monitor active community and enterprise leaderboard codes.
- API Credentials: Retrieve your public
clientId(e.g.,thrico_client_...) and provision client secrets. - Allowed Domains: Whitelist authorized CORS origins (e.g.,
https://rewards.yourcompany.com,http://localhost:*). - Embed & SDK: Live generator with instant drop-in HTML widgets, vanilla JS, React/Next.js components, and cURL snippets.
4. Quick Start (HTML CDN Integration)
Drop the Thrico Leaderboard SDK script onto any HTML webpage:
5. Connecting Members & User Identity (Email & User ID)
Thrico provides seamless identity resolution so your client application does not need to manage complex ID synchronization. You can connect and identify members using either their Email Address or User ID.
How Member Connection Works Under the Hood:
Option A: Connecting by Member Email (Recommended for Web Portals)
Most enterprise platforms identify logged-in users by email. You can directly query user standings using their email address:
Option B: Connecting by User UUID
If your system stores Thrico's participant UUID:
Automated Profile Enrichment & Avatars
When user data is returned:
- Avatar URLs: Automatically formatted to Thrico's CloudFront media CDN (
https://cdn.thrico.network/...). - Fallback Avatars: If no avatar was uploaded, defaults to
https://cdn.thrico.network/placeholder-user.jpg. - Earned Badges: Includes all unlocked badges with icons, titles, and achievement dates.
- Rank Movement: Pre-calculated movement indicators (
+3,-1, or0) comparing current rank to the previous snapshot.
6. Authentication & Domain Whitelisting
How It Works Under the Hood:
- You pass your public Client ID (
thrico_client_...) to the SDK. - The browser initiates a
POST /v1/sdk/auth/tokenrequest with the standard HTTPOriginheader (e.g.https://rewards.yourcompany.com). - The Thrico Gateway verifies that the incoming
Originmatches the tenant's Allowed Domains whitelist. - If whitelisted, the Gateway issues a short-lived (1-hour) signed JWT.
- The SDK's internal
TokenManagercaches this token and silently auto-renews it 5 minutes before expiration.
Whitelisting Origins:
Enterprise admins configure allowed origins in the Thrico Admin Portal at /gamification/points-and-badges/settings/leaderboard under the Allowed Domains tab, or via GraphQL:
Local Development: Adding localhost or http://localhost:* allows requests from any local development port (Next.js, Vite, Live Server).
7. JavaScript / TypeScript SDK Reference
Initialization (ThricoLeaderboard.init)
Initializes a singleton instance of the Thrico Leaderboard Client.
Parameters (LeaderboardClientConfig):
| Option | Type | Default | Description |
|---|---|---|---|
clientId | string | (Required) | Your enterprise Client ID (thrico_client_...). |
endpoint | string | "https://thrico-tracking.thrico.app" | Base URL of the Thrico SDK gateway. |
timeoutMs | number | 10000 | HTTP request timeout in milliseconds. |
autoRefreshIntervalMs | number | 0 (disabled) | Periodic background poll interval in milliseconds. |
Top-N Performers / Podium (getTopUsers)
Fetches the leading participants (typically Top 3) for rendering award podiums.
Arguments:
code(string): The leaderboard code identifier (e.g."rewards_monthly_champions").options(object, optional):limit(number): Number of entries to retrieve (Default:3, Max:20).
Return Type:
Paginated Leaderboard Entries (getEntries)
Retrieves paginated leaderboard rows with deterministic ordering and global rank preservation.
Arguments:
code(string): The leaderboard code identifier.options(object, optional):page(number): Page number (1-indexed). Page 2 starts at rank 21 (forlimit: 20).limit(number): Entries per page (Default:20, Max:100).cursor(string): Base64 cursor for high-performance cursor-based pagination.
Return Type:
Individual Rank Standing (getMyRank)
Fetches a specific user's rank position, movement, points, and percentile without loading the entire leaderboard.
Arguments:
code(string): Leaderboard code identifier.userId(string): UUID or identifier of the user.
Return Type:
Leaderboard Configuration (getConfig)
Retrieves metadata, active period dates, and display rules configured for the leaderboard.
List Active Leaderboards (listLeaderboards)
Lists all active leaderboards enabled for your enterprise client.
8. Direct REST API Reference (Headless & Mobile Apps)
For native mobile applications (iOS/Swift, Android/Kotlin) or backend microservices, all endpoints can be called directly over HTTP.
Base URL:
- Production Gateway:
https://thrico-tracking.thrico.app
1. Acquire Access Token
- Method:
POST - Path:
/v1/sdk/auth/token - Headers:
Content-Type: application/jsonOrigin: https://rewards.yourcompany.com
Request Body:
Success Response (HTTP 200):
2. Get Top Performers (Podium)
- Method:
GET - Path:
/v1/sdk/leaderboards/:code/top?limit=3 - Headers:
Authorization: Bearer <ACCESS_TOKEN>
Success Response (HTTP 200):
3. Get Paginated Entries
- Method:
GET - Path:
/v1/sdk/leaderboards/:code/entries?page=1&limit=20 - Headers:
Authorization: Bearer <ACCESS_TOKEN>
Success Response (HTTP 200):
9. Data Contracts & Models
LeaderboardEntry
| Field | Type | Description |
|---|---|---|
rank | number | True global rank position (1, 2, 3...). Page 2 starts at 21 for 20-item pages. |
points | number | Integer gamification points earned in this leaderboard period. |
previousRank | number | null | Rank position in previous snapshot period. null if first appearance. |
movement | number | null | Rank movement delta (previousRank - currentRank). Positive = climb, negative = drop. |
isNew | boolean | true if member newly entered the leaderboard standings. |
user | PublicLeaderboardUser | Public sanitized profile of the participant. |
PublicLeaderboardUser
| Field | Type | Description |
|---|---|---|
id | string | Unique participant UUID. |
displayName | string | Full name or masked name (e.g. "R***l S***a" if masking enabled). |
avatarUrl | string | High-resolution WebP avatar URL hosted on cdn.thrico.network. |
badges | Badge[] | Array of earned badges visible for this user. |
Badge
| Field | Type | Description |
|---|---|---|
id | string | Unique badge UUID. |
name | string | Badge title (e.g. "Grandmaster", "Champion", "Rising Star"). |
icon | string | null | Full CDN icon URL or emoji representation. |
10. Media & Image CDN Standards
To ensure optimal performance and avoid cross-origin image blocking:
- Origin Domain: All participant avatars and badge icons strictly resolve to:
- Standard Fallback:
If an avatar fails to load (network drop, ad-blocker), always use the official fallback placeholder:
- HTML Avatar Implementation:
11. End-to-End Implementation Example
Here is a complete, standalone implementation of a styled Gold/Silver/Bronze podium and paginated leaderboard:
12. Production Best Practices & Troubleshooting
1. Whitelist All Environment Origins
Ensure all environments where developers or customers access your web app are added to allowedDomains:
https://rewards.yourcompany.com(Production)https://staging-rewards.yourcompany.com(Staging)http://localhost:*(Local development)
Configure these in the Thrico Admin Portal at /gamification/points-and-badges/settings/leaderboard under Allowed Domains.
2. Auto-Refresh Strategy
For live dashboards, pass autoRefreshIntervalMs: 30000 (30 seconds) into ThricoLeaderboard.init(). The SDK will periodically synchronize rankings without triggering full page reloads.
3. Handle Token Expiry
The SDK manages token acquisition and renewal automatically via TokenManager. You do not need to manually store or refresh JWTs.
4. Handling Missing Badges
Not every participant has unlocked a badge. Always guard badge rendering:
📞 Support & Enterprise SLA
For questions, enterprise client onboarding, or high-throughput rate limit upgrades:
- Developer Documentation: https://docs.thrico.network
- API Status: https://status.thrico.network
- Technical Support:
support@thrico.network - Admin Dashboard Access: Navigate to Gamification → Points & Badges → Settings → Leaderboard (
/gamification/points-and-badges/settings/leaderboard)