Events
Soundcheck can emit events to the backstage events plugin.
Configuration
To enable events add the following configuration to your soundcheck config:
soundcheck:
events:
enabled: true
Make sure you are also running the most recent version of @spotify/backstage-plugin-soundcheck-node
, as this package includes typing for the events.
Event Types
There are currently two types of events supported, CheckStatusChangeEvent
and CertificationChangeEvent
.
CheckStatusChangeEvent
This event is emitted when a check status changes, for example if a check status goes from failed
to passed
.
Example Payload:
eventPayload: {
checkId: 'check-1',
entityRef: 'component:default/test-1',
state: 'passed',
timestampMs: 1743777961,
previousState: 'failed',
scope: 'default'
},
topic: 'soundcheck-check-status-change',
If there was no prior check status, the event's previousState
field will be undefined
.
To use this event you can subscribe to it via events service:
import { EventsService } from '@backstage/plugin-events-node';
import {
CHECK_STATUS_CHANGE_TOPIC,
CheckStatusChangeEvent,
} from '@spotify/backstage-plugin-soundcheck-node';
const subscribeToEvents = (events: EventsService) => {
events.subscribe({
id: 'test-sub',
topics: [CHECK_STATUS_CHANGE_TOPIC],
onEvent: async params => {
// handle event
},
});
}
//...
subscribeToEvents(eventsService);
CertificationStatusChangeEvent
This event is emitted when a certification state changes, for example if a certification for a level goes from failed
to passed
.
Example Payload:
eventPayload: {
trackId: 'track-1',
entityRef: 'component:default/test-1',
state: 'passed',
cumulativeState: 'passed',
levelOrdinal: 1,
timestampMs: 1743777961,
previousState: 'failed',
scope: 'default',
},
topic: 'soundcheck-certification-change',
If there was no prior certification status, the event's previousState
field will be undefined
.
To use this event you can subscribe to it via events service:
import { EventsService } from '@backstage/plugin-events-node';
import {
CERTIFICATION_CHANGE_TOPIC,
CertificationChangeEvent,
} from '@spotify/backstage-plugin-soundcheck-node';
const subscribeToEvents = (events: EventsService) => {
events.subscribe({
id: 'test-sub',
topics: [CERTIFICATION_CHANGE_TOPIC],
onEvent: async params => {
// handle event
},
});
}
//...
subscribeToEvents(eventsService);