Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@backstage/plugin-signals-node
Advanced tools
Welcome to the Node.js library package for the signals plugin!
Signals plugin allows backend plugins to publish messages to frontend plugins.
Add SignalService to your plugin environment in packages/backend/src/types.ts
:
import { SignalService } from '@backstage/plugin-signals-node';
export type PluginEnvironment = {
// ...
signalService: SignalService;
};
Add it also to your makeCreateEnv
to allow access from the other plugins:
import { SignalService } from '@backstage/plugin-signals-node';
import { DefaultEventBroker } from '@backstage/plugin-events-backend';
function makeCreateEnv(config: Config) {
// ...
const eventBroker = new DefaultEventBroker(root.child({ type: 'plugin' }));
const signalService = DefaultSignalService.create({
eventBroker,
});
return (plugin: string): PluginEnvironment => {
const logger = root.child({ type: 'plugin', plugin });
return {
logger,
eventBroker,
signalService,
// ...
};
};
}
To allow connections from the frontend, you should also install the @backstage/plugin-signals-backend
.
Once you have both of the backend plugins installed, you can utilize the signal service by calling the
publish
method. This will publish the message to all subscribers in the frontend. To send message to
all subscribers, you can use null
as recipients
parameter.
// Periodic sending example
setInterval(async () => {
await signalService.publish({
recipients: null,
channel: 'my_plugin',
message: {
message: 'hello world',
},
});
}, 5000);
To receive this message in the frontend, check the documentation of @backstage/plugin-signals
and
@backstage/plugin-signals-react
.
Other way to send signals is to utilize the EventBroker
directly. This requires that the payload is correct for it
to work:
eventBroker.publish({
topic: 'signals',
eventPayload: {
recipients: ['user:default/user1'],
message: {
message: 'hello world',
},
channel: 'my_plugin',
},
});
FAQs
Node.js library for the signals plugin
The npm package @backstage/plugin-signals-node receives a total of 10,151 weekly downloads. As such, @backstage/plugin-signals-node popularity was classified as popular.
We found that @backstage/plugin-signals-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.