All Projects → jezzsantos → ServiceStack.Webhooks

jezzsantos / ServiceStack.Webhooks

Licence: Apache-2.0 license
Add Webhooks to your ServiceStack services

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to ServiceStack.Webhooks

servicestack-configuration-consul
An implementation of ServiceStack IAppSettings interface that uses Consul.io key/value store as backing storage
Stars: ✭ 17 (-34.62%)
Mutual labels:  servicestack, servicestack-plugin
servicestack-request-correlation
A plugin for ServiceStack that creates a correlation id that allows requests to be tracked across multiple services
Stars: ✭ 12 (-53.85%)
Mutual labels:  servicestack, servicestack-plugin
servicestack-ratelimit-redis
A rate limiting plugin for ServiceStack that uses Redis for calculating and persisting request counts
Stars: ✭ 16 (-38.46%)
Mutual labels:  servicestack, servicestack-plugin
kotlin-ktor-exposed-sample-api
Kotlin Ktor Exposed SQL Immutable DB Rest API
Stars: ✭ 44 (+69.23%)
Mutual labels:  restful-api
rss2hook
POST to webhook(s) when new feed-items appear.
Stars: ✭ 33 (+26.92%)
Mutual labels:  webhook
go-zero
A cloud-native Go microservices framework with cli tool for productivity.
Stars: ✭ 23,294 (+89492.31%)
Mutual labels:  restful-api
readthis-api
100000p.com
Stars: ✭ 17 (-34.62%)
Mutual labels:  restful-api
Git Auto Deploy
Deploy your GitHub, GitLab or Bitbucket projects automatically on Git push events or web hooks
Stars: ✭ 251 (+865.38%)
Mutual labels:  webhook
open-rest-es6-boilerplate
open-rest boilerplate project with es6
Stars: ✭ 24 (-7.69%)
Mutual labels:  restful-api
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (-7.69%)
Mutual labels:  restful-api
appveyor-discord-webhook
⛓ Here's your serverless solution for sending build status from AppVeyor to Discord as webhooks.
Stars: ✭ 52 (+100%)
Mutual labels:  webhook
SmsForwarder
短信转发器——监控Android手机短信、来电、APP通知,并根据指定规则转发到其他手机:钉钉群自定义机器人、钉钉企业内机器人、企业微信群机器人、飞书机器人、企业微信应用消息、邮箱、bark、webhook、Telegram机器人、Server酱、PushPlus、手机短信等。包括主动控制服务端与客户端,让你轻松远程发短信、查短信、查通话、查话簿、查电量等。(V3.0 新增)PS.这个APK主要是学习与自用,如有BUG请提ISSUE,同时欢迎大家提PR指正
Stars: ✭ 8,386 (+32153.85%)
Mutual labels:  webhook
Text Classification TF
用tf实现各种文本分类模型,并且封装restful接口,可以直接工程化
Stars: ✭ 32 (+23.08%)
Mutual labels:  restful-api
M-Volunteer-SpringBoot
美志愿APP服务端,客户端在https://github.com/learner1999/M-Volunteer
Stars: ✭ 52 (+100%)
Mutual labels:  restful-api
Jonty.Blog
🎯Jonty.Blog个人博客项目,底层基于免费开源跨平台的.NET Core 3.1开发,使用 ABP vNext搭建项目框架,支持主流数据库,遵循RESTful接口规范,前端使用Blazor开发。
Stars: ✭ 42 (+61.54%)
Mutual labels:  restful-api
Webhookd
A very simple webhook server launching shell scripts.
Stars: ✭ 250 (+861.54%)
Mutual labels:  webhook
signalilo
Forward alerts from Prometheus Alertmanager to Icinga2 via Webhooks
Stars: ✭ 57 (+119.23%)
Mutual labels:  webhook
frame-backend
Frame API Build on JSON Web Tokens
Stars: ✭ 15 (-42.31%)
Mutual labels:  restful-api
laravel-admin
LaravelAdmin是基于PHP开发的基础管理后台系统,做到开箱即用,为新项目开发省去了基础功能开发的步骤;此系统采用前后端分离模式,后端使用Laravel,前端使用vue;主要包含:登录、注销、可视化数据大屏、管理员、角色管理、菜单管理、权限管理、错误日志、登录日志、访问日志、获取服务器CPU使用率、内存使用率等功能。后端主要使用Artisan命令行、Jobs消息队列、 Rules验证规则、Restful API、Composer扩展包、Redis秒杀、Extend自定义扩展类:微信授权、钉钉告警推送、MongoDB、阿里云OSS、七牛云存储、七牛云直播、php-jwt TOKEN、Phpoffice、MySql数据库字典、Elasticsearch等技术。
Stars: ✭ 45 (+73.08%)
Mutual labels:  restful-api
mezon
Mezon is a simple php framework wich will help you to create business applications.
Stars: ✭ 35 (+34.62%)
Mutual labels:  restful-api

License Build status

NuGet NuGet

Add Webhooks to your ServiceStack services

Release Notes

Overview

This project makes it very easy to expose webhook notifications from your ServiceStack services, and helps you manage your user's subscriptions to those webhooks.

By adding the WebhookFeature to the AppHost of your service, you automatically get all the pieces you need to raise and manage the events raised by your services.

We know that most services are built for scalability and to be hosted in the cloud, so we know that you are going to want to use your own components and technologies that fit in with your own architecture. All you have to do is plug into the WebhookFeature.

For example: In one service, you may want to store the Webhook subscriptions in a MongoDB database, and have an Azure worker role relay the events to subscribers from a (reliable) cloud queue.

In another service, you may want to store subscriptions in Ormlite SQL database, and relay events to subscribers directly from within the same service on a background thread, or throw the event to an AWS lambda to process. Whatever works for you, the choice is yours.

Oh, don't worry, getting started is easy. We got your back with a built-in subscription store and built-in event sink that will get you going seeing how it all works. But eventually you'll want to swap those out for your own pieces that fit your architecture, which is dead easy.

If you cant find the component you want for your architecture (see Plugins), it should be easy for you to build add your own and just plug it in.

Getting Started

Install from NuGet:

Install-Package ServiceStack.Webhooks

Simply add the WebhookFeature in your AppHost.Configure() method:

public override void Configure(Container container)
{
    // Add ValidationFeature and AuthFeature plugins first

    Plugins.Add(new WebhookFeature());
}

See Getting Started for more details.

Raising Events

To raise events from your own services:

  1. Add the IWebhooks dependency to your service
  2. Call: IWebhooks.Publish<TDto>(string eventName, TDto data)

As simple as this:

internal class HelloService : Service
{
    public IWebhooks Webhooks { get; set; }

    public HelloResponse Any(Hello request)
    {
        Webhooks.Publish("hello", new HelloEvent{ Text = "I said hello" });
    }
}

Subscribing to Events

Subscribers to events raised by your services need to create a webhook subscription to those events.

They do this by POSTing something like the following, to your service:

POST /webhooks/subscriptions
{
    "name": "My Webhook",
    "events": ["hello", "goodbye"],
    "config": {
        "url": "http://myserver/api/incoming",
    }
}

Consuming Events

To consume events, a subscriber needs to provide a public HTTP POST endpoint on the internet that would receive the POSTed webhook event.

The URL to that endpoint is defined in the config.url of the subscription (above).

In the case of the "hello" event (raised above), the POSTed event sent to the subscriber's endpoint might look something like this:

POST http://myserver/hello HTTP/1.1
Accept: application/json
User-Agent: ServiceStack .NET Client 4.56
Accept-Encoding: gzip,deflate
X-Webhook-Delivery: 7a6224aad9c8400fb0a70b8a71262400
X-Webhook-Event: hello
Content-Type: application/json
Host: myserver
Content-Length: 26
Expect: 100-continue
Proxy-Connection: Keep-Alive

{
    "Text": "I said hello"
}

To consume this event with a ServiceStack service, the subscriber would standup a public API like the one below, that could receive the 'Hello' event. That might have been raised from another service with a call to Webhooks.Publish("hello", new HelloEvent{ Text = "I said hello" }):

internal class MyService : Service
{
    public void Post(HelloDto request)
    {
        // They said hello!
        var message = request.Text;

       
        // The event name, messaging metadata are included in the headers
        var eventName = Request.Headers["X-Webhook-Event"];
        var deliveryId = Request.Headers["X-Webhook-Delivery"];
        var signature = Request.Headers["X-Hub-Signature"];
    }
}

[Route("/hello", "POST")]
public class HelloDto
{
    public string Text { get; set; }
}

Note: Webhook events can be delivered securely to subscribers using signatures, that proves the authenticity of the sender only. Delivered events are never encrypted, and only signed. See Subscriber Security for more details.

Documentation

More documentation about how the WebhookFeature works, and how to customize it are available in here

Contribute?

Want to get involved in this project? or want to help improve this capability for your services? just send us a message or pull-request!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].