Skip to content

Installation

Install the package

GraphDB is published as @graphdb/core on npm. Install it with your preferred package manager:

Terminal window
# Bun (recommended)
bun add @graphdb/core
# npm
npm install @graphdb/core
# pnpm
pnpm add @graphdb/core

The @graphdb/types package is included as a dependency of @graphdb/core — you don’t need to install it separately.

Import

import { GraphDB } from '@graphdb/core';

CommonJS

const { GraphDB } = require('@graphdb/core');

Type-only imports

If you need just the types (e.g., for interfaces in a separate file):

import type { Doc, Collection, Where, QueryOptions } from '@graphdb/core';

All types from @graphdb/types are re-exported from @graphdb/core, so you never need to import from @graphdb/types directly.

Compatibility

RuntimeMinimum Version
Bun1.x+
Node.js18+

GraphDB uses crypto.randomUUID() for ID generation, which requires Node.js 18 or later. Bun supports this natively.

Build formats

GraphDB ships dual CJS/ESM builds with TypeScript declaration files. Your bundler will automatically resolve the correct format.

Next steps

Head to the Quick Start to create your first database and collection.