OrbisDB SDK is an open-source Typescript module available on NPM.

Installation

You can install OrbisDB SDK with any package manager that supports the NPM registry

npm install @useorbis/db-sdk

Initialize the SDK

OrbisDB requires some basic configuration to work, mainly Ceramic and OrbisDB node gateways. There’s a slight difference based on the type of an instance you’re connecting to - learn more about instance types here (link).

Dedicated instance

When running OrbisDB and Ceramic locally, your gateways are Ceramic - http://localhost:7007 OrbisDB - http://localhost:7008

If you’re not self-hosting the instance, your information should be made available by your provider.

import { OrbisDB } from "@useorbis/db-sdk"

const db = new OrbisDB({
    ceramic: {
        gateway: "YOUR_CERAMIC_NODE_URL"
    },
    nodes: [
        {
            gateway: "YOUR_ORBIS_NODE_URL"
        }
    ]
})

Shared instance

When using a shared instance, such as OrbisDB Studio (link), you must provide an environment to connect to.

Environments

Shared OrbisDB instances are multi-tenant nodes that can host multiple, isolated, projects on a single node. All environments share the same underlying hardware, network and Ceramic node, but are logically separate with isolated databases, admins and configurations.

You can find your OrbisDB Studio (link) gateways on the home (Contexts) page. If you’re using a 3rd party provider, they should provide the information.

import { OrbisDB } from "@useorbis/db-sdk"

const db = new OrbisDB({
    ceramic: {
        gateway: "YOUR_CERAMIC_NODE_URL"
    },
    nodes: [
        {
            gateway: "YOUR_ORBIS_NODE_URL",
            env: "YOUR_ENVIRONMENT_ID"
        }
    ]
})