CEEJAYDocs

Dedicated instances

Point the SDK at your own CEEJAY instance.

Most communities are on the shared CEEJAY service, and need nothing on this page: the SDK sends there unless you say otherwise. A community on a dedicated instance has a dashboard at a URL of its own, and its API is served from that URL.

Pass your dashboard's base URL

Open your dashboard and copy the base URL from your browser's address bar, without any path, such as https://dashboard.example.com. Pass it as baseUrl:

Pass your dashboard's base URL
import { Ceejay } from '@communitystudios/ceejay'

const ceejay = new Ceejay({
  apiKey: process.env.CEEJAY_API_KEY,
  baseUrl: 'https://dashboard.example.com',
})

console.log(ceejay.baseUrl) // https://dashboard.example.com

Everything else is the same: the functions, the errors, the retries and the two signature checks.

What the base URL may look like

You passThe SDK sends to
NothingThe shared CEEJAY service
https://dashboard.example.comhttps://dashboard.example.com/api/v1/…
https://dashboard.example.com/The same
https://dashboard.example.com/api/v1The same

The base URL must start with https://, so your key is never sent unencrypted. Plain http:// is accepted for localhost only. A URL with a user name, a ? or a # is rejected. An invalid base URL throws a TypeError when the client is created, before anything is sent.

ceejay.baseUrl is the base URL the client sends requests to, without the key. Log it at start-up to see which instance a server talks to.

Keep the base URL with the key

A key only works on the instance where it was created. Store the two together, so a server cannot use the key of one instance with the base URL of another:

Keep the base URL with the key
import { Ceejay } from '@communitystudios/ceejay'

// CEEJAY_BASE_URL is not set for a community on the shared service.
const ceejay = new Ceejay({
  apiKey: process.env.CEEJAY_API_KEY,
  ...(process.env.CEEJAY_BASE_URL ? { baseUrl: process.env.CEEJAY_BASE_URL } : {}),
})

const member = await ceejay.members.get('409876543210987654')
console.log(member.displayName)

A key sent to the wrong instance is rejected with status 401 and the message Invalid API key.

Every request is under /api/v1

Every function sends requests to the dashboard's base URL followed by /api/v1. You pass the same baseUrl for every function.

ceejay.quests.reportTask used to send to /api/quests/external/complete, outside /api/v1. That older endpoint keeps working for code that calls it without the SDK. The SDK sends to /api/v1/quests/tasks/complete.

Check what your instance has

A dedicated instance is updated on its own. ceejay.community.get reports which version of the API it serves and which features it supports, so call it once when your server starts. See Community.

Requests CEEJAY sends to you

A dedicated instance signs its webhooks and its shop deliveries the same way as the shared service. verifyWebhook and verifyDelivery need no base URL: they only need the secret. See Verifying signatures.

An instance that has not been updated yet sends the legacy signature only, and both functions reject it unless you pass allowLegacy. That page explains how.

On this page

Community StudiosPrivacyTerms