Java SDK

The local Java SDK artifact is com.credvault:credvault-edge version 1.0.0. It uses OkHttp for HTTP requests and Gson for JSON serialization.

Installation

If CredVault gives you a local JAR, install it into your local Maven repository first:

Terminal
mvn install:install-file \
  -Dfile=credvault-edge-java-1.0.0.jar \
  -DgroupId=com.credvault \
  -DartifactId=credvault-edge \
  -Dversion=1.0.0 \
  -Dpackaging=jar
What you should seeA completed package install with no dependency errors.

Then add it to your project.

For Gradle:

gradle
implementation 'com.credvault:credvault-edge:1.0.0'

For Maven:

xml
<dependency>
  <groupId>com.credvault</groupId>
  <artifactId>credvault-edge</artifactId>
  <version>1.0.0</version>
</dependency>

If your organization publishes the SDK to a private Maven registry or Maven Central, use that registry instead of installing the JAR by hand.

Connecting to CredVault

The SDK defaults to http://localhost:5000/api, which is only for local backend development. Production code must pass the CredVault backend API URL.

java
import com.credvault.sdk.CredVaultClient;

String apiKey = System.getenv("CREDVAULT_API_KEY");
CredVaultClient client = new CredVaultClient(
    apiKey,
    "https://<your-credvault-backend>/api"
);

String customers = client.data.query("customers", "{\"status\":\"active\"}");
System.out.println(customers);

Create one client and reuse it across your service.

Working with Data

The Java SDK returns JSON strings from API calls. Parse them into your own DTOs when you need strongly typed application objects.

java
String customers = client.data.query("customers", "{\"status\":\"active\"}");
System.out.println(customers);

Available Resources

  • auth for sign-in and sign-up
  • data for clusters and collection data
  • cie for datasets, models, and predictions
  • webhooks for event delivery
  • functions for serverless functions
  • triggers for collection events
  • backups for backup and restore
  • schema for schema and indexes
  • apiKeys for API key management
  • metrics for platform monitoring
  • logs for activity and audit logs
  • notifications for notifications; preference methods should be checked against /api-docs
  • settings for account settings, but some methods still need backend route alignment
  • robots for robot/device endpoints, but this area still needs route alignment before it is public-ready

Security

Read API keys from environment variables, your platform secret manager, or your deployment system. Do not commit API keys to source control or package them inside a JAR.