Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zenginehq/frontend-webhooks

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zenginehq/frontend-webhooks

Helper library for working with webhooks in Zengine frontend plugins.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
5
Weekly downloads
 
Created
Source

Frontend Webhooks

Helper module for working with webhooks in Zengine frontend plugins.

Installation

# Run this from your frontend plugin's src diretory.
npm i @zenginehq/frontend-webhooks --save

It's important that this gets inside under the plugins/myplugin/src directory, alongside your plugin's other code if not Maya won't build it properly.

Usage

plugin.controller('MyAwesomeController', ['$scope', 'wgnWebhook', 'wgnScheduledWebhook', function ($scope, webhook, scheduledWebhook) {
	
  $scope.onSomething(function () {
  	var params = {
  		//'url': 'http://www.example.com/endpoint',
  		'url': 'myservice',     // <--- notice how you can pass a backend service name and the url will get built automatically.
  		'form.id': 123
  	};
  	
    webhook.create(params).then(function (webhook) {
    	console.log(webhook.id);
    	console.log(webhook.secretKey);
    });
    
    // Enable or disable webhooks.
    webhook.enable(webhookId);
    webhook.disable(webhookId);
    
    // Use the exact same API to deal with Scheduled Webhooks.
    scheduledWebhook.create();
    scheduledWebhook.enable();
    scheduledWebhook.disable();
	});

}]);

Regular vs Scheduled Webhooks

Notice in the example above there are 2 different services being used wgnWebhook and wgnScheduledWebhook, they each deal with different kinds of Zengine resources but both expose the exact same API with the following methods available:

  • create: creates a new webhook
  • enable: enables a webhook
  • disable: disables a webhook
  • delete: deletes a webhook
  • update: updates a webhook

Keywords

FAQs

Package last updated on 17 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc