Java SDK v3

The Lattice SDK for Java v3 introduces a number of changes:

  • ⚠️ Breaking change - Alter how enum types are generated to support forward-compatible enums. These now follow a visitor pattern
  • Fixes for SSE streaming
1switch (event.getEventType().get()) {
2 case EVENT_TYPE_PREEXISTING:
3 System.out.println("Received pre-existing entity event");
4 break;
5 default:
6 System.out.println("Default case");
7 break;
8}

Updated all Java examples to use the new addHeader method for adding authentication headers, simplifying how Sandbox authentication headers are set in Java applications.

java-headers.diff
1--- java-client-before.java 2025-09-05 10:00:00
2+++ java-client-after.java 2025-09-05 10:30:00
3@@ -1,19 +1,11 @@
4 import com.anduril.Lattice;
5-import okhttp3.OkHttpClient;
6
7 public class LatticeClientExample {
8 public static void main(String[] args) {
9 String endpoint = System.getenv("LATTICE_ENDPOINT");
10 String token = System.getenv("ENVIRONMENT_TOKEN");
11 String sandboxesToken = System.getenv("SANDBOXES_TOKEN");
12-
13- // Create HTTP client with Sandbox authentication
14- OkHttpClient httpClient = new OkHttpClient.Builder()
15- .addInterceptor(chain -> {
16- return chain.proceed(chain.request().newBuilder()
17- .header("Anduril-Sandbox-Authorization", "Bearer " + sandboxesToken)
18- .build());
19- })
20- .build();
21-
22+
23+ // Create Lattice client with Sandbox authentication
24 Lattice client = Lattice.builder()
25 .url(endpoint)
26 .token(token)
27- .httpClient(httpClient)
28+ .addHeader("Anduril-Sandbox-Authorization", "Bearer " + sandboxesToken)
29 .build();
30 }
31 }

Java SDK Improvements

The Lattice SDK for Java 2.3.0 introduces a simplified approach for adding authentication headers to API requests:

  • Added new addHeader method to the Lattice client builder that eliminates the need to create custom OkHttpClient instances.
  • Updated all Java examples to use this new approach, resulting in cleaner, more maintainable code.
  • Removed boilerplate OkHttpClient interceptor configuration that was previously required.

The Lattice SDK now supports streaming entity updates in real-time using the REST API across all supported languages:

  • Added StreamEntities API for establishing persistent connections to stream entity events
  • Implemented examples for streaming entities in Go, Java, Python, and TypeScript
  • Updated documentation to demonstrate both basic streaming and component filtering

New features

The new StreamEntities API provides several configurable parameters:

  • preExistingOnly: Controls whether to stream only existing entities or include real-time updates.
  • heartbeatIntervalMS: Configures how frequently the server sends heartbeat events.
  • componentsToInclude: Allows filtering which entity components are streamed, reducing bandwidth usage and improving performance.

Documentation updates

As a part of this release, Watch entities guide has been updated with code examples in all supported languages. Each example demonstrates both basic entity streaming and filtering specific components, providing common patterns for integrating real-time entity data into your Lattice apps.


Existing developers

This major version update introduces breaking changes from SDK v1. If you are a current Lattice SDK developer, version v1 will continue to work but will no longer be maintained. We recommend upgrading to Lattice SDK v2.

Lattice SDK v1 is built to natively support gRPC, while v2 uses OpenAPI to offer a more streamlined experience. To choose a migration path that works for you, see migration guide.

New REST SDKs

The Lattice SDK introduces improved access to the Lattice SDK with REST support. Simply install the Lattice SDK in a language of your choice to get started building with Lattice:

1package main
2
3import (
4 "github.com/anduril/lattice-sdk-go/v2/client"
5 "github.com/anduril/lattice-sdk-go/v2/option"
6)
7
8func main() {
9 client := client.NewClient(
10 option.WithToken("LATTICE_TOKEN"),
11 option.WithBaseURL("LATTICE_URL"),
12 )
13
14 client.Entities.GetEntity(
15 context.TODO(),
16 "ENTITY_ID",
17 )
18}

The Buf Schema registry

The Lattice Protobuf definitions are now published, and available from the Buf Schema registry.

Shows the Buf schema registry.

Use the Lattice protos and a plugin of your choice, to generate SDK artifacts for your language of choice. For more information, and to see an example in Go, see Generate the Lattice SDK for gRPC.

Objects API

Lattice now supporting a resilient, distributed binary object store, letting you efficiently store binary data and relate them to entities in your environment. Some use cases include:

  • Creating image thumbnails for tracks in the Lattice UI.
  • Maintaining CSV data for entities for implementing vessel manifests, or other relevant entity metadata.
Lattice UI object store.

The Objects API lets you upload, retrieve, and delete objects across the Lattice mesh. For more information, see Objects in the Lattice SDK Guide.