Skip to content

Creating Your Hoglin Instance

The Hoglin SDK is designed to be flexible and easy to configure. In this guide, we’ll walk you through basic SDK initialization along with additional configurations to suit your needs. This instance will be your entrypoint for all Hoglin features.



Hoglin analytics = new Hoglin.Builder("api_key")
.build();

The Hoglin.Builder class provides several options to configure your Hoglin instance

MethodTypeDefaultDescription
enableAutoFlush(b)BooleantrueWhether to auto-flush events (perioidcally send a batch of queued events)
enableAutoExperimentFetch(b)BooleantrueWhether to automatically fetch and cache experiment data perioidcally
requeueFailedFlushes(b)BooleantrueWhether events that failed to get flushed should be added back to the event queue
autoFlushInterval(ms)Long15000How often (ms) to auto-flush
autoExperimentFetchInterval(ms)Long60000How often (ms) to automatically fetch experiment data
maxBatchSize(n)Int10000Max events sent per auto-flush, extra requests will remain in the queue
baseUrl(url)Stringhttps://api.hoglin.ggAPI endpoint - should never be changed outside of certain circumstances
executor(executor)ScheduledExecutorService[…]The default executor used for Hoglin - only change this if you know what you’re doing!
gson(gson)GSON[…]The Gson instance used for serialization and deserialization - register custom serializers instead if applicable