Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
@mediarithmics/plugins-nodejs-sdk
Advanced tools
This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate
This is the mediarithmics SDK for building plugins in Typescript or raw Node.js easily. As this package includes Typescript interfaces, we recommend that you use it with Typescript.
It covers (as of v0.1.0):
Coming soon:
This module is installed via npm:
npm install --save @mediarithmics/plugins-nodejs-sdk
A mediarithmics plugin is called by the mediarithmics platform wih a 'Request' that contains all the Data to process / evaluate. Each type of plugin, depending on its functional behavior, is receiving a different request payload.
The plugin SDK contains a typescript interface describing the format of the request for each supported plugin.
A request can be:
Please see the complete documentation here.
A plugin instance can have a configuration that will change the way it will process Requests. As a plugin will be called numerous time to process Requests but its configuration is retrieved only once every 30 seconds for performance reasons.
Note: The plugin instance configuration can be done through mediarithmics console or by API.
The Instance Context is an object that contains this configuration and is rebuilt every 30 seconds.
The plugin SDK provide a default Instance Context Builder function for each type of plugin it supports called by default. This generate a basic Instance Context that will be available during the plugin runtime. The interface of this default Instance Context is also provided in the SDK.
If you need to have a custom Instance Context format because you can pre-calculate or charge in memory some values (ex: if you need to compile a Template / load in memory a statistic model / etc.), you can:
Firstly, you'll need to import the proper base class for your plugin. Each plugins has to import 3 class:
import {
AdRendererBasePlugin,
AdRendererRequest,
AdRendererBaseInstanceContext
} from '@mediarithmics/plugins-nodejs-sdk';
import {
ActivityAnalyzerPlugin,
ActivityAnalyzerRequest,
ActivityAnalyzerBaseInstanceContext,
ActivityAnalyzerPluginResponse
} from '@mediarithmics/plugins-nodejs-sdk';
When instantiating a plugin, you need to give him the main 'processing' function that he will process every time a Request is being received.
const plugin = new AdRendererBasePlugin(
(
request: AdRendererRequest,
instanceContext: AdRendererBaseInstanceContext
) => {
(...) // Processing
return html;
}
);
const plugin = new ActivityAnalyzerPlugin(
(
request: ActivityAnalyzerRequest,
instanceContext: ActivityAnalyzerBaseInstanceContext
) => {
(...) // Processing
return response;
}
);
You just have to call the '.start()' method on your plugin to launch it!
0.1.2 - 2017-08-08
FAQs
This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate
The npm package @mediarithmics/plugins-nodejs-sdk receives a total of 179 weekly downloads. As such, @mediarithmics/plugins-nodejs-sdk popularity was classified as not popular.
We found that @mediarithmics/plugins-nodejs-sdk 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.