JavaScript
import { TrophyApiClient } from '@trophyso/node'; const trophy = new TrophyApiClient({ apiKey: 'YOUR_API_KEY' }); const response = await trophy.streaks.rankings({ limit: 20, type: 'active' });
[ { "userId": "user-123", "name": "Alice Johnson", "streakLength": 15 }, { "userId": "user-456", "name": "Bob Smith", "streakLength": 12 }, { "userId": "user-789", "name": "Charlie Brown", "streakLength": 8 } ]
Get the top users by streak length (active or longest).
Number of users to return. Must be between 1 and 100.
1 <= x <= 100
Whether to rank users by active streaks or longest streaks ever achieved.
active
longest
Successful operation
The ID of the user.
"user-123"
The name of the user. May be null if no name is set.
"Alice Johnson"
The user's streak length (active or longest depending on query parameter).
15
Was this page helpful?