OrbisDB SDK is an open-source Typescript module available on NPM.
You can install OrbisDB SDK with any package manager that supports the NPM registry
npm install @useorbis/db-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).
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"
}
]
})
When using a shared instance, such as OrbisDB Studio (link), you must provide an environment to connect to.
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"
}
]
})