Skip to main content
Use the SDK to explore your organization’s Asset Map, find assets, and follow their connections. You can retrieve part of the graph as JavaScript objects or compose a Cypher query to select specific information. Both read the same map shown in the platform, using your API key’s organization.

How the graph is organized

Assets are represented as nodes. Each node has an ID, labels describing what it is, and properties containing its details. A Supabase database, for example, has both SupabaseDatabase and Database labels. Its properties include its hostname and database version. These labels let you query a specific integration’s resources or work across integrations using a shared category. Edges describe directed relationships between nodes. A HAS_DATABASE edge connects a Supabase project to its database. A RESOURCE edge connects an account or organization to the resources it contains. The available labels, properties, and relationships depend on the integrations connected to your map.

Retrieve assets and their connections

Call antigen.assetMap.get() with one or more asset IDs. Set depth to control how far to explore their connections.
This returns the selected project and its immediate neighbors. Increasing depth to 2 also includes assets connected to those neighbors. Connections are followed in both directions. Each returned edge retains its original direction, so you can distinguish a project’s database from the organization that contains the project.

Parameters

Return value

The result contains nodes and edges arrays. Nodes appear once in the result, even when several paths lead to them. Each edge references nodes in the returned array through fromId and toId.
You can use these arrays to display a graph or inspect relationships in your own code. For example, this finds the databases connected to the selected project:

Query the map

Use antigen.assetMap.query() when you want to select assets by their properties, follow particular relationships, or compute values such as resource counts. Build the query with Neo4j’s Cypher Builder:
This example finds Supabase projects in a region and returns their IDs and names:
Cypher.Param supplies the region as a query parameter. The aliases in .return() name the fields in each result:
You can use those IDs to explore the matching projects:

Parameters

Return value

Returns an array of rows. Each row contains the fields selected by the query. A query with no matches returns an empty array. Queries can select properties, nodes, relationships, paths, and aggregate values. Returned nodes and edges use the same representation as get(). Paths contain nodes and edges arrays. The builder provides TypeScript types for constructing queries. Label names, property names, and result fields depend on the graph schema.

Node and edge fields

Node

Edge

Access

Both methods provide read-only access to your organization’s map. Queries that create, update, or delete graph data are rejected. You can call these methods from scripts, applications, or external agent environments using API key authentication. Connecting infrastructure is covered in Connecting infrastructure.