This is a .NET library that provides a wrapper around the Hack Club Arcade API, allowing developers to easily interact with endpoints related to user sessions, statistics, goals, and history. Please note that this library is not officially maintained by Hack Club.
You can install the package via NuGet:
dotnet add package HackClub.Arcade
To get started, initialize an instance of ArcadeWrapper
with your Hackclub Arcade API key:
using HackClub.Arcade;
// Initialize the wrapper with your API key
var arcadeWrapper = new ArcadeWrapper("your-api-key");
// Example usage: Retrieve user statistics
var userStats = arcadeWrapper.GetUserStats();
Console.WriteLine($"Total sessions: {userStats.TotalSessions}");
// Example usage: Start a new session
var startResult = arcadeWrapper.StartSession("Working on a project");
Console.WriteLine($"Session started at: {startResult.StartTime}");
// Example usage: Pause the current session
var pauseResult = arcadeWrapper.PauseSession();
Console.WriteLine($"Session paused: {pauseResult.Paused}");
// Example usage: Retrieve session history
var sessionHistory = arcadeWrapper.GetSessionHistory();
foreach (var session in sessionHistory)
{
Console.WriteLine($"Session ID: {session.SessionId}, Duration: {session.Duration}");
}
For further guidance and examples, refer to the Example Projects.
Checks if the Arcade API server is reachable.
Retrieves statistics for the current user.
Retrieves information about the latest session for the current user.
Retrieves goals associated with the current user.
Retrieves session history entries for the current user.
Starts a new session for the user with the specified work description.
Pauses or resumes the current session for the user.
Cancels the current session for the user.
For the source code, refer to the Simple Usage.