Authentication
User authentication and session management via wallet signatures or Immutable Passport
Base: /api/v1/authComplete REST API documentation for Funstack SDK
User authentication and session management via wallet signatures or Immutable Passport
Base: /api/v1/authHow to authenticate API requests
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"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}'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();