![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@zenginehq/backend-webhooks
Advanced tools
Helper library for working with Webhooks in Zengine backend plugins.
Helper module for working with Webhooks in Zengine backend Plugins.
npm i @zenginehq/backend-webhooks --save
var $webhook = require('@zenginehq/backend-webhooks');
var $firebase = require('@zenginehq/backend-firebase');
var $api = require('@zenginehq/backend-http');
var workspaceId; // from eventData
var activity; // from eventData
// Load settings from firebase.
$firebase.load(workspaceId).then(function (settings) {
if (!$webhook.validateSecret(settings, eventData.request)) {
return eventData.response.status(403).send('Invalid Webhook Key');
}
// Load activity.
return $api.getActivity(activity.id).then(function (fullActivity) {
if ($webhook.activityToFolder(fullActivity, settings.submittedFolder)) {
// Do something.
}
// You can also make sure the activity didn't come from a specific folder.
if (!$webhook.activityFromFolder(fullActivity, settings.submittedFolder)) {
// Do something else.
// $api.moveToFolder(approcvedfolder);
}
});
});
Returns whether the webhook id and secret match what's stored in settings.
Out of the box expects the id to be stored in settings.webhookId
and the key in settings.webhookKey
.
You can customize this by calling $webhook.setIdField('myIdField)
and $webhook.setKeyField('myKeyField')
.
Returns whether the given activity is a move to the specified folder (ie: record moved from a folder into this one)
Returns whether the given activity is a move from the specified folder (ie: record moved from this folder this another one)
1.2.1 (2018-10-17)
<a name="1.2.0"></a>
FAQs
Helper library for working with Webhooks in Zengine backend plugins.
We found that @zenginehq/backend-webhooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.