API Reference

Complete REST API documentation for Funstack SDK

Authentication

User authentication and session management via wallet signatures or Immutable Passport

Base: /api/v1/auth

Authentication

How to authenticate API requests

Bearer Token Authentication

Include your JWT token in the Authorization header for authenticated endpoints:

curl -X GET "https://api.xp-platform.com/api/v1/rewards/balance" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

API Key Authentication (Server-to-Server)

For server-side integrations, use your game's API key:

curl -X POST "https://api.xp-platform.com/api/v1/rewards/grant" \
  -H "X-API-Key: YOUR_GAME_API_KEY" \
  -H "X-API-Secret: YOUR_GAME_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"playerId": "player_123", "amount": 100}'

Rate Limits

1000
requests/minute
Standard tier
10,000
requests/minute
Pro tier
Unlimited
requests/minute
Enterprise

Using the SDK

While you can use the REST API directly, we recommend using our SDK for easier integration

import { XPSDK } from '@xp-platform/sdk';

const sdk = new XPSDK({ gameId: 'your-game-id' });

// Authenticate
await sdk.auth.loginWithWallet();

// Get player stats
const stats = await sdk.profile.getStats();

// Show rewarded ad
const reward = await sdk.ads.showRewardedAd();

// Claim rewards on-chain
await sdk.rewards.claim();