Xbox Adapter for Idiomark
Fetches game library, achievements, clips, and profile data from Xbox Live API for personality analysis.
Features
- ✅ Profile with gamerscore and tenure
- ✅ Game library with achievement data
- ✅ Achievement progress tracking
- ✅ Game clips (content creation signals)
- ✅ Activity feed
- ✅ Friend list and social connections
- ✅ Rate limiting (200 requests/minute)
- ✅ OAuth 2.0 authentication via Microsoft Identity Platform
Authentication
Requires Microsoft OAuth 2.0 access token:
- Register your app at Azure Portal
- Configure OAuth 2.0 redirect flow
- User authorizes and you receive an access token
- Use the token with this adapter
import { createXboxAdapter } from '@idiomark/adapter-xbox'
const adapter = createXboxAdapter('YOUR_ACCESS_TOKEN', {
userId: 'xuid(123456789)', // Optional
gamertag: 'Gamertag' // Optional
})
// Authenticate
await adapter.authenticate()
// Fetch data
const data = await adapter.getStructuredOutput({
includeProfile: true,
includeGames: true,
includeAchievements: true,
includeClips: true,
includeActivity: true
})
Personality Signals Extracted
| Signal Type | Description |
|---|---|
| Playstyle | achievement-focused, social, competitive, casual, or creator |
| Genre Preferences | Most played game genres |
| Dedication | Based on gamerscore per day |
| Creativity | Clip creation frequency |
| Social Gaming | Multiplayer focus, party activity |
| Values | dedication, creativity, social engagement, competitiveness |
API Endpoints Used
| Endpoint | Purpose |
|---|---|
| Achievements API | User achievements |
| Profile API | User profile and gamerscore |
| Titles API | Game library |
| Activity API | Activity feed |
| Clips API | Game clips |
| People/Social API | Friend list |
Rate Limits
- 200 requests per minute (conservative limit)
- Automatic throttling built-in
Data Types
interface XboxProfileStats {
totalGames: number
totalGamerscore: number
totalAchievements: number
achievementCompletionRate: number
clipCount: number
screenshotCount: number
friendCount: number
accountAge: number // Days
favoriteGenres: string[]
mostPlayedGames?: Array<{
name: string
gamerscore: number
}>
activityLevel: 'low' | 'medium' | 'high'
}
Authentication Flow
The Xbox adapter requires an OAuth 2.0 access token. For production use:
- Register App at Azure Portal
- Redirect User to Microsoft login
- Receive Callback with authorization code
- Exchange Code for access token
- Get XUID from Xbox profile service
License
MIT