
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@inferagraph/cosmosdb-datasource
Advanced tools
Azure Cosmos DB NoSQL datasource plugin for @inferagraph/core.
pnpm add @inferagraph/cosmosdb-datasource @inferagraph/core @azure/cosmos
import { CosmosDbDatasource } from '@inferagraph/cosmosdb-datasource';
const datasource = new CosmosDbDatasource({
endpoint: 'https://your-account.documents.azure.com:443/',
key: 'your-key',
database: 'my-database',
container: 'my-container',
});
await datasource.connect();
const view = await datasource.getInitialView();
console.log(view.nodes, view.edges);
await datasource.disconnect();
getNeighbors(nodeId, depth) supports depth > 1. Cosmos DB NoSQL has no native graph traversal, so the datasource does an application-level BFS — one 1-hop fan-out per level, deduping nodes and edges by id. Single-hop callers see no change.
| Option | Required | Description |
|---|---|---|
endpoint | Yes | Cosmos DB account endpoint URL |
key | Yes | Account key for authentication |
database | Yes | Database name |
container | Yes | Container name for nodes (and edges if not separated) |
edgesContainer | No | Separate container for edge documents |
partitionKeyPath | No | Partition key path (default: /type) |
Nodes and edges are stored as JSON documents differentiated by a _docType field:
Node document:
{
"id": "node-1",
"_docType": "node",
"name": "Example Node",
"type": "person"
}
Edge document:
{
"id": "edge-1",
"_docType": "edge",
"sourceId": "node-1",
"targetId": "node-2",
"type": "related_to"
}
MIT
FAQs
Azure Cosmos DB NoSQL datasource for InferaGraph
We found that @inferagraph/cosmosdb-datasource demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.