Watch entities
This shows how to use the SDK to fetch entities from Lattice and stream real-time information about entity components.
Complete the steps to learn how to use the following APIs:
GetEntity
— Retrieves a single entity from Lattice.
Before you begin
- To configure your app to watch entities, set up your Lattice environment.
- Learn about required components and various entity shapes in Lattice.
Get an entity
Get details of a specific entity using an entity_ID
and the GetEntity
API:
Copy the entity ID
Choose Copy Content from the drop down menu, then choose Copy Asset URL:

Extract the unique entity ID from this URL. For example, in the following,
the entity ID is YOUR_ENTITY_ID
:
https://your_lattice_url.com/c2/entities/YOUR_ENTITY_ID
Stream entity components
Available only in gRPC
This API is availble only in gRPC. To use it, you must generate your own artifacts using the Lattice protobuf definitions in the Buf Schema Registry website.
For more information about generating your own artifacts, see Generate Lattice SDK gRPC.
Use the StreamEntityComponents
API
to stream components whenever an entity object is updated. Lattice lets you stream all components when you set
includeAllComponents
to true
. To specify which components to stream, set the componentsToInclude
and provide a
list of components in snake_case
: [“location_uncertainty”, “aliases”]
What’s next?
- Learn more about the Entities API in REST and gRPC.
- Learn how to Publish entities to Lattice.
- Check out the Lattice sample apps.