Config 1.x is a release candidate. npm's latest tag still installs 0.x, so install these docs' version from the rc tag:
npm i @adonis-agora/config@rc
node ace configure @adonis-agora/configThe same goes for every @adonis-agora/* package these docs install: add @rc, and where a page says node ace add, install with @rc first and then run node ace configure. On 0.x? Read the 0.x docs.
Console
Entries per app, environment and label — edit, diff any two versions, roll back, audit.
The console lives on the control plane, at the same prefix as the tenant API (/_config). It is
the Agora console shell (the shared tokens, fonts and sidebar), violet where the other consoles have
their own colour.
import { authkitDashboardAuthorize } from '@adonis-agora/authkit-client'
defineConfig({
topology: 'control-plane',
verifyTenant,
console: {
// Omitted: open outside production, every request denied in production.
authorize: authkitDashboardAuthorize({ role: 'ADMIN' }),
revealSecrets: true,
// apps: ['streaming', 'billing'],
},
})authorize takes the contract every Agora console uses: an inline function, an authorizer class, or
a lazy import. authorizeByToken, anyAuthorize and resolveConsoleAuthorize are exported from
@adonis-agora/config for machine access.
What it does
| Page | |
|---|---|
| Entries | every key of the selected app/environment/label, with its value, secret and reloadable flags, who last wrote it and when. Search, filter and paginate. Over the list: the current version, when the scope was created and last updated. Opening an entry shows when it was created and last updated. |
| Editor | set a value (JSON or text), a vault:// reference, description and the reason; a secret is encrypted at rest, seal for <app> hands it to the tenant's key so the server cannot read it, a reloadable key applies without a restart, and browser lets the app's pages read it (off by default, unavailable on a secret). |
| History | every immutable version: who, when, how many entries and secrets, and why. |
| Diff | any two versions, key by key: added, removed, changed, with secret values masked. |
| Rollback | copies a past version into a new version (history stays append-only), with the reason recorded. |
| Audit | who changed what, when, and why — including reveal rows for secrets. |
A secret arrives masked in the console. The operator asks for it explicitly (the eye button),
which calls POST <api>/entries/:key/reveal and writes a reveal audit row; revealSecrets: false
removes the button entirely. An entry sealed for an app says sealed for <app> and has no reveal:
the control plane holds only ciphertext, and only that app's private key opens it.
Filters are in the URL: copy the link to share a filtered view. The app/environment/label picked in
the topbar (app, env, label), the Entries search and page (q, page), the History page,
open version and diff (page, version, from, to) and the Audit action and page (action,
page) all live in the hash, so /config#/history?env=staging&from=10&to=12 opens that diff, and
back/forward step through your picks.
The JSON API
Same-origin, JSON, and the list envelopes follow the Agora list convention ({ data, meta }).
| Route | |
|---|---|
GET /meta | apps, environments, labels, the default scope, whether secrets are configured |
GET /entries?app&environment&label&search&page&size&sort | entries, filtered and paginated, plus document: { version, createdAt, updatedAt } (the scope's current version, when the scope was first written and when it last changed; null before the first write) |
GET /entries/:key | one entry (secret masked), with createdAt (when the key was first set) and updatedAt / updatedBy |
PUT /entries/:key | set value/vault/flags/description; a new version |
DELETE /entries/:key | unset; a new version |
POST /entries/:key/reveal | the secret value, audited |
GET /versions GET /versions/:version | history and one version |
GET /diff?from&to | the changes between two versions |
POST /rollback | { to, message? } |
GET /audit | the trail, filtered by filter[key] / filter[action] |
GET /consoles GET /consoles/search?q= | the console switcher and ⌘K |
An unknown sort or filter[field] is a 400; a masked secret is not an error. CORS is the
host app's.
GET /audit and GET /versions also page by cursor. Send first (and after with the previous
page's meta.nextCursor) and the answer is { data, meta: { nextCursor, prevCursor, hasNext, hasPrev } }, with no total. A deep page costs what the first one does. The console pages this way;
page/size keep the offset envelope and its total.
Shell, switcher and ⌘K
The page embeds the standard Agora data block (viewer, signOut, switcher, search). The
console joins the 'agora.consoles' registry as config, so every other Agora console lists
"Configuration" and searches entry keys. With authkit-client, sign-out and the viewer row appear
with no per-console config; without it, set console.signOut and console.viewer yourself.
Who the audit records
Every change and reveal made in the console records an actor. By default that is the authkit-client
identity, else ctx.auth.user, else console. When people sign in some other way, say who they
are with console.actor. For example, on a Hub that uses the authkit console session:
import { realAccountId } from '@adonis-agora/authkit-server'
export default defineConfig({
topology: 'control-plane',
// ...
console: {
authorize: hubAdminAuthorize,
actor: (ctx) => ({ id: realAccountId(ctx) }),
},
})If the hook returns no id, or throws, the default actor is recorded.
Which apps a viewer sees
console.apps limits the console to a set of apps: the pickers list them and an API request for
another app is refused with 403.
authorize can narrow that per viewer by answering { allowed: true, apps }, the same grant the
telescope and flags consoles take:
authorize: async (ctx) => {
const user = ctx.auth.user
if (!user) return { allowed: false, reason: 'unauthenticated' }
return { allowed: true, apps: user.isAdmin ? '*' : user.managedApps }
},The viewer sees and changes only those apps, in the pickers, the API, ⌘K and the MCP tools.
'*' (or no apps) means every app. console.apps stays the upper bound: a granted app outside
it is still refused.
Production
The console is a browser app behind your app's auth. Keep the authorize rule explicit in
production: the default denies everything there, and a forgotten rule is a locked door, not an open
one.