Skip to content

@camera.ui/sdk / plugin / NotifierInterface

Interface: NotifierInterface

Defined in: plugin/notifier.ts:101

Implemented by plugins that deliver notifications. The NotificationManager invokes these methods over RPC. Plugins own their device storage — the manager never persists devices itself.

Methods

getDevice()

getDevice(deviceId): Promise<NotifierDevice | null>

Defined in: plugin/notifier.ts:110

Returns a single device by id, or null if not found.

Parameters

deviceId

string

Returns

Promise<NotifierDevice | null>


getDevices()

getDevices(ownerUserIds): Promise<NotifierDevice[]>

Defined in: plugin/notifier.ts:108

Returns every device this notifier knows about for the given users. Each device carries its ownerUserId so the caller can map results back. May return [] when the notifier is unavailable (e.g. license invalid). Called frequently — keep cheap.

Parameters

ownerUserIds

string[]

Returns

Promise<NotifierDevice[]>


notificationSettings()?

optional notificationSettings(): Promise<JsonSchema[] | undefined>

Defined in: plugin/notifier.ts:138

Returns the JSON schema used to render the notifier's settings form in the UI, or undefined for no schema.

Returns

Promise<JsonSchema[] | undefined>


registerDevice()

registerDevice(ownerUserId, input): Promise<NotifierDevice>

Defined in: plugin/notifier.ts:121

Creates a new device on this notifier. input is plugin-specific JSON whose schema the notifier defines; the NotificationManager forwards it opaquely.

Parameters

ownerUserId

string

input

Record<string, unknown>

Returns

Promise<NotifierDevice>


revokeDevice()

revokeDevice(deviceId): Promise<void>

Defined in: plugin/notifier.ts:126

Permanently removes a device. Called when the user revokes the device through their notifier-specific UI.

Parameters

deviceId

string

Returns

Promise<void>


sendNotification()

sendNotification(deviceIds, n): Promise<void>

Defined in: plugin/notifier.ts:115

Delivers a notification to the given devices in one call. Errors are logged; the manager never aborts a fan-out because one notifier failed.

Parameters

deviceIds

string[]

n

Notification

Returns

Promise<void>


updateDevice()

updateDevice(deviceId, patch): Promise<NotifierDevice | null>

Defined in: plugin/notifier.ts:133

Mutates a subset of fields on an existing device. patch is plugin-agnostic (name, active); plugins ignore unknown keys. Returns the updated device, or null if the id isn't ours so the manager can probe the next plugin.

Parameters

deviceId

string

patch

Record<string, unknown>

Returns

Promise<NotifierDevice | null>