Java SDK for Relewise. Find detailed usage examples on our docs site.
API-key authentication remains available through the existing client constructors:
var tracker = new Tracker(datasetId, apiKey, "https://api.relewise.com");Backend applications can authenticate with OAuth 2.0 Client Credentials instead of an API key. Keep the client secret on the server and never include it in browser or other client-side code. OAuth requires the dataset's HTTPS server URL; credentials, query strings, and fragments are not allowed in that URL.
var credentials = new OAuthClientCredentials(oauthClientId, oauthClientSecret);
var tracker = new Tracker(datasetId, credentials, relewiseServerUrl);Create the Relewise client once and reuse it for subsequent requests. Each client instance owns an in-memory token provider which acquires a token on the first request, shares it between concurrent requests, renews it shortly before expiry, and retries an API request once if the server reports Bearer error="invalid_token". Creating a new client creates a new token cache and can cause another token request.
The configured timeout applies separately to each HTTP exchange. Token acquisition, the API request, and any token refresh or API retry each receive the full configured timeout.
The same credentials type can be passed to Searcher, Recommender, and SearchAdministrator.
Install via Maven.
<dependency>
<groupId>com.relewise.client</groupId>
<artifactId>relewise-sdk</artifactId>
<version>1.8.0</version>
</dependency>Pull requests are always welcome. Please fork this repository and make a PR when you are ready with your contribution.
Otherwise you are welcome to open an Issue in our issue tracker.
relewise-sdk-java is licensed under the MIT license
Check DEVELOPMENT.md for details on running this project locally for development.
The opt-in OAuth integration test uses DATASET_ID, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, and optionally SERVER_URL from the environment. It is skipped when the OAuth variables are absent.
Check PUBLISH.md for details about the release workflow and how to troubleshoot it.