|
2 | 2 |
|
3 | 3 | [![Build status][build-status]][build]
|
4 | 4 | # SocketLabs.EventWebhooks.Extensions
|
5 |
| -> If you are reading, someone used a template and never updated the readme. |
6 |
| -> |
7 |
| ->Please update me 😢. |
| 5 | +> Library to make consuming SocketLabs webhooks easier. |
8 | 6 |
|
9 | 7 | ## Getting Started
|
10 | 8 | ### Prerequisites
|
11 | 9 |
|
12 | 10 | * Visual Studio or VSCode
|
13 |
| -* .NET 7 |
| 11 | +* .NET 8 |
14 | 12 |
|
15 |
| -### Building |
| 13 | +### Usage |
16 | 14 |
|
17 |
| -1. CI builds are configured in [Azure DevOps][build] |
| 15 | +Import using dotnet CLI or the Package Manager console in Visual Studio |
18 | 16 |
|
19 |
| -### Installation |
| 17 | +#### dotnet cli |
20 | 18 |
|
21 |
| -1. CI Deployments are deployed automatically in [Azure DevOps Releases][release] |
| 19 | +```shell |
| 20 | +dotnet add package SocketLabs.EventWebhooks.Extensions |
| 21 | +``` |
| 22 | + |
| 23 | +#### Package Manager |
| 24 | + |
| 25 | +```powershell |
| 26 | +Install-Package SocketLabs.EventWebhooks.Extensions |
| 27 | +``` |
| 28 | + |
| 29 | +Inject the webhook services |
| 30 | + |
| 31 | +```csharp |
| 32 | +var builder = WebApplication.CreateBuilder(args); |
| 33 | + |
| 34 | +// Code removed for brevity ... |
| 35 | +
|
| 36 | +// Add the webhook endpoints |
| 37 | +builder.Services.AddWebhookEndpoints(builder.Configuration); |
| 38 | + |
| 39 | +// Add custom implementation of IWebhookEventHandler |
| 40 | +builder.Services.AddSingleton<IWebhookEventHandler, WebhookEventHandler>(); |
| 41 | + |
| 42 | +``` |
| 43 | + |
| 44 | +Add webhook configurations |
| 45 | + |
| 46 | +#### appsettings.json |
| 47 | +```javascript |
| 48 | +{ |
| 49 | + "WebhookOptions": { |
| 50 | + "WebhookEndpoints": [ |
| 51 | + { |
| 52 | + "Name": "cc0b4dc6-d867-49f5-9d8e-8357997789af", |
| 53 | + "SecretKey": "Z123456AbcD1234563Ef" |
| 54 | + } |
| 55 | + ] |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +Configure Endpoint URL in portal |
| 61 | + |
| 62 | +``` |
| 63 | +https://example.com/api/v1/webhookevents/cc0b4dc6-d867-49f5-9d8e-8357997789af |
| 64 | +``` |
22 | 65 |
|
23 | 66 | ### Release History
|
24 | 67 |
|
25 | 68 | * 1.0.0 Initial Release
|
26 | 69 |
|
27 |
| -### Documentation |
| 70 | +### License |
28 | 71 |
|
29 |
| -Documentation is available in [Confluence][docs] |
| 72 | +[MIT License](LICENSE.md) |
30 | 73 |
|
31 |
| -### License |
| 74 | +### Contributing |
32 | 75 |
|
33 |
| -This code base is confidential and not for public distribution at this time. |
| 76 | +[Contributor Guidelines](CONTRIBUTING.md) |
34 | 77 |
|
35 | 78 | <!-- MARKDOWN LINKS & IMAGES -->
|
36 | 79 | <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
37 |
| -[build-status]: https://dev.azure.com/socketlabs/ServiceProvider/_apis/build/status/SocketLabs.Template.Worker-CI?branchName=main |
38 |
| -[build]: https://dev.azure.com/socketlabs/SelfService/_build?definitionId=0 |
39 |
| -[release]: https://dev.azure.com/socketlabs/SelfService/_release?view=all&_a=releases&definitionId=0 |
40 |
| -[docs]: https://socketlabs.atlassian.net/wiki/spaces/SSR/ |
| 80 | +[build-status]: https://dev.azure.com/socketlabs/Public%20Projects/_apis/build/status/SocketLabs.EventWebhooks.Extensions-CI?branchName=main |
| 81 | +[build]: https://dev.azure.com/socketlabs/Public%20Projects/_build/latest?definitionId=170 |
0 commit comments