https://github.com/trophyso/trophy-java
Java library for the Trophy API.
https://github.com/trophyso/trophy-java
api api-client gamification gamification-engine gamification-framework gamification-platform gradle java maven sdk
Last synced: about 1 month ago
JSON representation
Java library for the Trophy API.
- Host: GitHub
- URL: https://github.com/trophyso/trophy-java
- Owner: trophyso
- License: mit
- Created: 2025-02-09T11:44:42.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-08-28T10:19:02.000Z (10 months ago)
- Last Synced: 2025-08-28T17:33:12.111Z (10 months ago)
- Topics: api, api-client, gamification, gamification-engine, gamification-framework, gamification-platform, gradle, java, maven, sdk
- Language: Java
- Homepage: https://trophy.so
- Size: 119 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trophy Java SDK
The Trophy Java SDK provides convenient access to the Trophy API from applications written in Java.
Trophy provides APIs and tools for adding gamification to your application, keeping users engaged
through rewards, achievements, streaks, and personalized communication.
## Installation
### Gradle
Add the following dependency to your `build.gradle` file:
```groovy
implementation 'so.trophy:trophy-java:1.0.0'
```
### Maven
Add the following dependency to your `pom.xml` file:
```xml
so.trophy
trophy-java
1.0.0
```
## Usage
The package needs to be configured with your account's API key which is available in the Trophy
dashboard.
```java
import so.trophy.*;
import so.trophy.resources.metrics.requests.MetricsEventRequest;
import so.trophy.types.EventRequestUser;
import so.trophy.types.EventResponse;
public class Main {
public static void main(String[] args) {
// Create a new trophy client
TrophyApiClient client = TrophyApiClient.builder()
.apiKey("YOUR_API_KEY")
.build();
// Create a new event request
MetricsEventRequest request = MetricsEventRequest.builder()
.user(
EventRequestUser.builder()
.id("USER_ID")
.email("jk.rowling@harrypotter.com")
.build()
)
.value(750)
.build();
// Send the event request and log the created event ID
EventResponse response = client.metrics().event("words-written", request);
System.out.println(response.getEventId());
}
}
```
## Documentation
See the [Trophy API Docs](https://docs.trophy.so) for more
information on the accessible endpoints.