https://github.com/trophyso/trophy-node
NodeJS SDK for the Trophy API
https://github.com/trophyso/trophy-node
api api-client expressjs gamification gamification-engine gamification-framework gamification-platform nestjs nextjs nodejs npm-package sdk
Last synced: 10 months ago
JSON representation
NodeJS SDK for the Trophy API
- Host: GitHub
- URL: https://github.com/trophyso/trophy-node
- Owner: trophyso
- License: mit
- Created: 2025-02-08T10:24:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-30T14:09:17.000Z (11 months ago)
- Last Synced: 2025-08-08T23:29:06.109Z (10 months ago)
- Topics: api, api-client, expressjs, gamification, gamification-engine, gamification-framework, gamification-platform, nestjs, nextjs, nodejs, npm-package, sdk
- Language: JavaScript
- Homepage: https://trophy.so
- Size: 161 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trophy NodeJS SDK
The Trophy Node SDK provides convenient access to the Trophy API from applications written in
server-side JavaScript.
Trophy provides APIs and tools for adding gamification to your application, keeping users engaged
through rewards, achievements, streaks, and personalized communication.
## Installation
Install the package with:
```bash
npm install @trophyso/node
```
## Usage
The package needs to be configured with your account's API key, which is available in the Trophy
web interface. Set the API key with the following:
```javascript
const { TrophyApiClient } = require('@trophyso/node');
const trophy = new TrophyApiClient({ apiKey: 'your-api-key' });
```
You can now access the Trophy API through the `trophy` object.
```javascript
trophy.metrics.event('words-written', {
user: {
id: '18',
email: 'jk.rowling@harrypotter.com',
tz: 'Europe/London',
},
value: 750,
});
```
## Usage with TypeScript
Trophy maintains types for this SDK. You can use them without any additional configuration.
## Documentation
See the [Trophy API Docs](https://docs.trophy.so) for more
information on the accessible endpoints.