Migrate to v2

The v2 release of the Lattice SDK represents a change in SDK implementation, and not in the underlying Lattice services or APIs.

The underlying Lattice services continue to support both REST and gRPC protocols.

If you’re an existing Lattice developer, you have three migration paths to choose from:

  1. Continue using gRPC with Buf (recommended): If your apps use gRPC, or you have existing Lattice integrations that use gRPC, get the artifacts directly from the Buf Schema Registry. If you prefer to continue using gRPC and want to generate clients compatible with Lattice SDK v1, use the following plugin versions when getting the artifacts from Buf:

    Python

    We do not recommend using betterproto moving forward, as the plugin does not support type Any. For Python, we recommend using the grpc/python plugin.

  2. Migrate to SDK v2 (recommended): We recommend this option for most new developers. The REST-based SDKs provide a more streamlined development experience and better browser compatibility.

  3. Maintain v1 usage (not recommended): While you can continue using v1 gRPC-based packages without changes, we do not recommend this approach. New versions of the Lattice SDK include new features and critical updates to existing resources.

Use the following table to help you decide which migration path is best for you:

RESTgRPC
InstallationPackages via PyPi, Maven, npm, source via GitHubPackages generated in Buf Schema Registry
Language SupportPython, Typescript, Java, GolangAuto-generated bindings for 16 languages
Streaming On the roadmap
Familiarity and toolingMore frequently usedLess frequently used
API availabilityEntities, Tasks, and ObjectsEntities and Tasks
On-the-wire size JSON Encoding Binary Encoding
Browser support Better Weaker

The following steps guide you through the first two recommended paths.

Before you begin

  • Check the version of the Lattice SDK package:

    $go list -m github.com/anduril/lattice-sdk-go

    If your version starts with 1.x.x, continue with the migration guide:

Option 1: Use v2 with gRPC

The following shows how to update from v1 to v2 gRPC implementation in Go:

1

Update your Lattice SDK dependency

Update your go.mod file to include the new version of the gRPC client:

$go get buf.build/gen/go/anduril/lattice-sdk/grpc/go@v1.5.1-20250716223851-f58576d79c34.2

This fetches the specified version from the Buf Schema Registry.

2

Update import statements and instansiation

Update your imports to use the new version of the client. The following .diff shows the necessary changes needed to use grpc/go@1.5.1, the same plugin version used for Lattice SDK v1:

Go
1--- v1.go
2+++ v2.go
3@@ -5,7 +5,8 @@ import (
4 "log"
5 "os"
6
7- entitymanagerv1 "github.com/anduril/lattice-sdk-go/src/anduril/entitymanager/v1"
8+ "buf.build/gen/go/anduril/lattice-sdk/grpc/go/anduril/entitymanager/v1/entitymanagerv1grpc"
9+ entitymanagerv1 "buf.build/gen/go/anduril/lattice-sdk/protocolbuffers/go/anduril/entitymanager/v1"
10 "google.golang.org/grpc"
11 "google.golang.org/grpc/credentials"
12 )
13@@ -30,15 +31,16 @@ func main() {
14 if err != nil {
15 log.Fatalf("did not connect: %v", err)
16 }
17+ defer conn.Close()
18
19- client := entitymanagerv1.NewEntityManagerAPIClient(conn)
20+ client := entitymanagerv1grpc.NewEntityManagerAPIClient(conn)
21
22- request := &entitymanagerv1.GetEntityRequest{
23+ response, err := client.GetEntity(ctx, &entitymanagerv1.GetEntityRequest{
24 EntityId: "<ENTITY_ID>",
25- }
26- response, err := client.GetEntity(ctx, request)
27+ })
28
29 if err != nil {
30 log.Fatalf("Error fetching entity: %v", err)
31 }
32 log.Printf("Response: %v", response)

Option 2: Use v2 with REST

If you’re migrating from the v1 gRPC SDK to the v2 REST SDK, follow these steps to update your implementation:

1

Install the REST SDK

Follow the SDK setup guide to install the REST SDK for your preferred language.

For Go, do the following:

1go get github.com/anduril/lattice-sdk-go/v2
2

Update import statements and SDK usage

When migrating from the gRPC implementation to REST, you’ll need to update how you initialize and configure the client:

rest-go-v1-v2.diff
1--- grpc_v1.go 2025-08-01 10:11:20
2+++ rest_v2.go 2025-08-01 12:07:40
3@@ -5,39 +5,26 @@
4 "log"
5 "os"
6
7- entitymanagerv1 "github.com/anduril/lattice-sdk-go/src/anduril/entitymanager/v1"
8- "google.golang.org/grpc"
9- "google.golang.org/grpc/credentials"
10+ "github.com/anduril/lattice-sdk-go/v2/client"
11+ "github.com/anduril/lattice-sdk-go/v2/option"
12 )
13
14 func main() {
15 ctx := context.Background()
16 latticeEndpoint := os.Getenv("LATTICE_ENDPOINT")
17 environmentToken := os.Getenv("ENVIRONMENT_TOKEN")
18
19 if latticeEndpoint == "" || environmentToken == "" {
20 log.Fatalf("Missing required environment variables")
21 }
22- auth := &BearerTokenAuth{
23- Token: environmentToken,
24- }
25
26- opts := []grpc.DialOption{
27- grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")),
28- grpc.WithPerRPCCredentials(auth),
29- }
30- conn, err := grpc.NewClient(latticeEndpoint, opts...)
31- if err != nil {
32- log.Fatalf("did not connect: %v", err)
33- }
34+ client := client.NewClient(
35+ option.WithToken(environmentToken),
36+ option.WithBaseURL(latticeEndpoint),
37+ )
38
39- client := entitymanagerv1.NewEntityManagerAPIClient(conn)
40+ response, err := client.Entities.GetEntity(ctx, "<ENTITY_ID>")
41
42- request := &entitymanagerv1.GetEntityRequest{
43- EntityId: "<ENTITY_ID>",
44- }
45- response, err := client.GetEntity(ctx, request)
46-
47 if err != nil {
48 log.Fatalf("Error fetching entity: %v", err)
49 }

What’s next?