Skip to content

Quick Start

  • A GamifyHost partner account
  • An App created in the dashboard
  • Your API keys (public key + secret key)

From your backend, call the Award Points endpoint whenever a user performs a rewardable action.

Terminal window
curl -X POST https://api.gamifyhost.com/v1/points/award \
-H "X-API-Secret: sk_test_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_12345",
"eventType": "signup",
"displayName": "Alice",
"email": "alice@example.com"
}'

The user is created automatically if they don’t exist. Points are awarded based on the reward rule configured for the signup event type in your dashboard.

Add the game widget to your frontend so users can spend their points:

<div id="gamifyhost" style="width:100%;height:80vh;"></div>
<script
src="https://cdn.gamifyhost.com/widget.js"
data-public-key="pk_test_your_public_key"
data-user-id="user_12345"
data-api-url="https://api.gamifyhost.com"
data-initial-balance="5000"
></script>

Or use the Flutter SDK:

import 'package:gamifyhost_games/gamifyhost_games.dart';
GamifyHostWidget(
config: const GamifyHostConfig(
publicKey: 'pk_test_your_public_key',
userId: 'user_12345',
initialBalance: 5000,
),
)

Users see a game listing, pick a game, and spend points to play. The server determines the outcome and returns the reward.

The widget includes a built-in leaderboard. You can also query it directly:

Terminal window
curl https://api.gamifyhost.com/v1/leaderboard?page=1&limit=10 \
-H "X-API-Key: pk_test_your_public_key"