About five minutes, on the free plan, without a credit card.
1
Add the dependency
The package is published to Maven Central as fr.idcapture:openpanel-java. For Gradle use implementation 'fr.idcapture:openpanel-java:0.4.0' (Groovy) or implementation("fr.idcapture:openpanel-java:0.4.0") (Kotlin DSL).
<dependency>
<groupId>fr.idcapture</groupId>
<artifactId>openpanel-java</artifactId>
<version>0.4.0</version>
</dependency>
2
Initialise the client
Set apiUrl to https://api.privytics.com. The SDK hardcodes OpenPanel's own host as the default, so this line is required. The client secret is needed for server-side events.
import fr.idcapture.openpanel.OpenPanel;
import fr.idcapture.openpanel.OpenPanelOptions;
OpenPanel op = OpenPanel.create(
OpenPanelOptions.builder()
.clientId("YOUR_CLIENT_ID")
.clientSecret("YOUR_CLIENT_SECRET")
.apiUrl("https://api.privytics.com")
.build()
);
3
Track an event
Pass an event name on its own, or add properties and the user id the event belongs to.
// Minimal
op.track("page_viewed");
// With properties
op.track("button_clicked", Map.of("button_id", "submit_form"));
// With the user it belongs to
op.track("checkout_started", Map.of("cart_value", 149.99), "user123");
4
Set global properties and shut down cleanly
Global properties are merged into every track() call, which is a good fit for backend metadata like release version and environment. OpenPanel implements AutoCloseable, so close it explicitly or use try-with-resources when your application stops.
op.setGlobalProperties(Map.of(
"app_version", "2.1.0",
"env", "production"
));
// Subsequent calls include app_version and env automatically
op.track("feature_used", Map.of("feature", "export"));
// Shut down the client when your application stops
op.close();