The neeto-webhooks-nano
manages webhooks within neeto applications. The nano
exports the @bigbinary/neeto-webhooks-frontend
NPM package
and neeto-webhooks-engine
Rails engine for development.
The engine is used to manage webhooks across neeto products.
-
Add this line to your application's Gemfile:
source "NEETO_GEM_SERVER_URL" do # ..existing gems gem 'neeto-webhooks-engine' # Use this for live development: # gem 'neeto-webhooks-engine', path: "../neeto-webhooks-nano" end
-
And then execute:
bundle install
-
Add this line to your application's
config/routes.rb
file:mount NeetoWebhooksEngine::Engine => "/webhooks"
-
Run the following command to copy the migrations from the engine to the host application:
rails g neeto_webhooks_engine:install
-
Add the migrations to the database:
bundle exec rails db:migrate
-
Add the following line to application's config/initializer/neeto_webhooks_engine.rb file. Replace the event_identifiers with an array of unique keywords representing possible webhook events.
NeetoWebhooksEngine.event_identifiers = ["create", "update", "cancel"]
-
Add translations for the webhook events using the key format webhooks.events.webhook_event, where webhook_event is the custom-defined event_identifier.
webhooks: events: create: "Booking creation" update: "Booking reschedule" cancel: "Booking cancellation"
-
Add the permission
neeto_webhooks_engine.manage_webhooks
to yourpermissions.yml
file.
You can learn more about the setup and usage here:
- Install the latest
neeto-webhooks-nano
package using the below command:yarn add @bigbinary/neeto-webhooks-frontend
Check the Frontend package development guide for step-by-step instructions to develop the frontend package.
NeetoWebhooks
(source code)
This component is used to manage webhooks in your web application.
- It provides a user interface for viewing, adding, and editing webhooks.
- It also includes a user interface for listing deliveries and viewing delivery details, featuring tabs that display both request and response information.
-
entityId
: Specifies the ID of the entity. -
entityType
: Specifies the type of the entity.
-
breadcrumbs
: An array of objects that specify breadcrumbs for navigation. -
helpLinkUrls
: An object that specifies the URLs for the help links.-
webhooks
: The URL for the webhooks help link. -
secrets
: The URL for the secrets help link. -
deliveries
: The URL for the deliveries help link.
-
import React from "react";
import { NeetoWebhooks } from "@bigbinary/neeto-webhooks-frontend";
import { routes } from "common/routes";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import { ToastContainer } from "react-toastify";
const Main = () => (
<BrowserRouter>
<div className="flex">
<Switch>
<Route
path={routes.webhooks}
component={() => (
<NeetoWebhooks
entityId={entityId}
entityType={entityType}
breadcrumbs={[
{
text: "Settings",
link: routes.settings,
},
{ text: "Webhook" },
]}
helpLinkUrls={{
webhooks:
"https://help.neetokb.com/articles/creating-a-webhook",
secrets:
"https://help.neetokb.com/articles/securing-webhook-requests",
deliveries:
"https://help.neetokb.com/articles/managing-webhook-deliveries",
}}
/>
)}
/>
</Switch>
</div>
<ToastContainer />
</BrowserRouter>
);
export default Main;
Consult the building and releasing packages guide for details on how to publish.