atlasv-leaderboard
v0.3.3
Published
an ad leaderboard for fb
Readme
Leaderboard SDK
Introduction
This SDK provides a simple yet powerful interface for managing and querying game leaderboards. It supports setting player scores, retrieving leaderboard data, and querying weekly and daily leaderboards.
Installation
npm install leaderboard-sdkQuick Start
- Import and initialize the SDK:
import { initializeLeaderboard } from 'leaderboard-sdk'
const leaderboard = initializeLeaderboard({
app_id: 'YOUR_APP_ID',
userIDGetter: async () => 'USER_ID',
host: 'https://api.example.com',
})- Set a player's score:
const response = await leaderboard.setScore({
player_id: '123',
player_name: 'John Doe',
player_avatar_url: 'https://example.com/avatar.png',
country: 'US',
score: 1000,
ts: Date.now(),
})- Retrieve leaderboard data:
const data = await leaderboard.getScore({
limit: 10,
sort_order: SortOrder.DESC,
})Documentation
For detailed API documentation, please refer to the API Reference.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue for any bugs, improvements, or features. Check out our Contributing Guidelines for more information.
