Getting Started
Follow these steps to get up and running with Hoglin:
-
Create a Server
Section titled “Create a Server”If you haven’t already created a server in Hoglin, follow the guide. Otherwise, continue to step two.
-
Install the SDK
Section titled “Install the SDK”Add the Hoglin SDK to your project:
build.gradle.kts repositories {maven {url = uri("https://jitpack.io")}}dependencies {implementation("gg.hoglin:sdk:TAG")}build.gradle repositories {maven {url 'https://jitpack.io'}}dependencies {implementation 'gg.hoglin:sdk:TAG'}pom.xml <repositories><repository><id>jitpack.io</id><url>https://jitpack.io</url></repository></repositories><dependencies><dependency><groupId>gg.hoglin</groupId><artifactId>sdk</artifactId><version>TAG</version></dependency></dependencies>
-
Initialize the SDK
Section titled “Initialize the SDK”Configure Hoglin with your server settings:
val analytics = Hoglin.Builder("<your server key>").autoFlushInterval(5_000L) // How frequent events should be sent.maxBatchSize(50) // The maximum amount of events that need to be sent.build()Hoglin analytics = new Hoglin.Builder("<your server key>").autoFlushInterval(5_000L) // How frequent events should be sent.maxBatchSize(50) // The maximum amount of events that need to be sent.build(); -
Track Your First Event
Section titled “Track Your First Event”Track your first event anywhere with
Hoglin#track
:@EventHandlerfun playerJoin(event: PlayerJoinEvent) {analytics.track("player_join", mapOf("player_uuid" to event.player.uniqueId))}@EventHandlerpublic void playerJoin(PlayerJoinEvent event) {analytics.track("player_join", Map.of("player_uuid", event.getPlayer().getUniqueId()));} -
View Your Data
Section titled “View Your Data”Log in to your dashboard to see events in real time 🎉
For more information about the SDK, read the SDK Reference