Skip to main content

installIntegrationRegistry

Attaches the integrations singleton onto window.OCA.OpenRegister.integrations and drains any registrations that were queued by a stub before this module loaded.

OpenRegister's main bundle calls this once at bootstrap. Consuming apps don't normally call it directly — they just register() on the global once the page has loaded OpenRegister.

Bootstrap-order safety

If a consuming app's bundle loads before OpenRegister's, it installs a queue stub:

window.OCA = window.OCA || {}
window.OCA.OpenRegister = window.OCA.OpenRegister || {}
window.OCA.OpenRegister.integrations = window.OCA.OpenRegister.integrations || {
_queue: [],
register(entry) { this._queue.push(entry) },
}

When OpenRegister loads and calls installIntegrationRegistry(), every queued entry is replayed against the real registry in insertion order. Failed replays are logged in development and skipped in production — they never block subsequent registrations.

Signature

import { installIntegrationRegistry } from '@conduction/nextcloud-vue'

installIntegrationRegistry() // attach to window
installIntegrationRegistry(fakeWindow) // attach to test double
ArgumentTypeDefaultDescription
globalRefobject?windowGlobal to attach to. Pass an override in tests to avoid mutating the real window.

Returns

The installed registry instance (the integrations singleton).

See also