1 min read
Java / Spring SDK
Spring Boot auto-configuration and servlet filter for Java metering.
Updated 2026-07-29Suggest edits
Get the Java SDK
The Java SDK lives in the public repo github.com/aforoai/SDKs under
aforo-metering-sdks/java.Install & Quickstart#
Add Aforo metering to your Java service. Spring Boot auto-configuration and a manual TrackEvent client.
Requires Java 17+ (uses java.net.http.HttpClient and records). The artifact is com.aforo:metering.
Manual Tracking
Spring Boot Auto-Configuration
The auto-configuration wires an AforoClient bean and a request-end servlet filter that runs after the response is committed (no added latency). It resolves the customer from the Spring Security principal, then X-Customer-Id, then X-Api-Key; requests with none of those are skipped.
See also