Before you start
Java 11+, Maven or Gradle, and a Private API Key. The SDK uses Jackson for JSON. Register and verify the website domain in your analytics dashboard. Use credentials from the same domain and environment as the browser check. For a fresh account, start with Quick Start.Get your credentials
Copy the domain’s Private API Key from Integration > API keys and store it asSHIELDLABS_API_KEY in your server environment. For webhook verification, also set SHIELDLABS_WEBHOOK_SECRET from Integration > Webhooks. Never expose either secret to the browser.
Install the SDK
Add the integration
Save this asQuickStart.java in a project that depends on shieldlabs-java:
SHIELDLABS_API_KEY set and a request ID as the argument. A runnable backend with both halves (a signup guard and a webhook receiver) lives in examples/httpserver.
Test the complete flow
- Use the Request ID from a real browser check on the same domain as the Private API Key.
- Confirm the server retrieves that identification and its Risk Score.
- Test an invalid or missing ID and an unavailable API: none should be treated as a clean identification.
- For webhooks, test the original raw body with its signature, then change one byte and confirm rejection.
SDK models are normalized from the response they receive. Current History reads omit the weighted signal breakdown and some newer flags; an empty
signals array or a defaulted flag does not establish that no detection fired. Use a verified scored webhook for the complete versioned detection payload. Group events require their own handler; check that your installed SDK accepts their schema.Troubleshooting
- No History row: confirm the registered domain, credential/environment match and that the browser remained open while collectors posted.
- Missing or pending verdict: scoring is asynchronous. The server helper waits within a bounded budget; handle a missing result and API errors explicitly.
- Authentication error: use the Private API Key for History, not a Public Key, Management Secret Key or MCP OAuth token.
- Invalid webhook signature: verify the original raw bytes with the endpoint’s full signing secret, before trusting parsed JSON.