Skip to content

trophyso/trophy-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trophy .NET Library

The official Trophy .NET library.

Trophy provides APIs and tools for adding gamification to your application, keeping users engaged through rewards, achievements, streaks, and personalized communication.

Installation

Using the .NET Core command-line interface (CLI) tools:

dotnet add package Trophy

Using the NuGet Command Line Interface (CLI):

nuget install Trophy

Using the Package Manager Console:

Install-Package Trophy

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "Trophy".
  5. Click on the Trophy package, select the appropriate version in the right-tab and click Install.

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:

using TrophyApi;

var trophy = new TrophyApiClient("YOUR_API_KEY");

Then you can access the Trophy API through the trophy client. For example, you can send a metric event:

var user = new EventRequestUser {
   Id = "18",
   Email = "[email protected]"
};

var request = new MetricsEventRequest {
   User = user,
   Value = 750
};

await trophy.Metrics.EventAsync("words-written", request);

Documentation

See the Trophy API Docs for more information on the accessible endpoints.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages