@frontegg/client
Advanced tools
Comparing version 1.2.19 to 2.0.0
@@ -1,2 +0,2 @@ | ||
export * from './EventsClient'; | ||
export * from './types'; | ||
export * from './events'; |
@@ -6,3 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./EventsClient")); | ||
__export(require("./types")); | ||
__export(require("./events")); | ||
//# sourceMappingURL=index.js.map |
@@ -1,9 +0,4 @@ | ||
export * from './WebpushProperties.interface'; | ||
export * from './BellProperties.interface'; | ||
export * from './AuditProperties.interface'; | ||
export * from './TriggerOptions.interface'; | ||
export * from './BellAction.interface'; | ||
export * from './ChannelsConfiguration.interface'; | ||
export * from './WebhookBody.type'; | ||
export * from './Channels.type'; | ||
export * from './SlackProperties.interface'; | ||
export * from './channel-configuration'; | ||
export * from './errors'; | ||
export * from './event-types'; | ||
export * from './status-types'; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./errors")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@frontegg/client", | ||
"version": "1.2.19", | ||
"version": "2.0.0", | ||
"description": "Frontegg Javascript Library for backend", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -16,2 +16,45 @@ # Frontegg Client | ||
## Breaking changes | ||
### v2.0 Events client upgraded to use the v3 Events API | ||
As we grow as a company we also provide new and improved APIs such as the new v3 Events API. | ||
This will allow your to configure more and worry less about channels. It is still not perfect, but we're getting there. | ||
With the new v3 api you'll be able to use the frontegg portal to map events to channels in order to allow your customers to configure their own channels. | ||
The new client will no longer send the channels you wish to trigger, and just use the event's payload. | ||
Please note that email & slack may still require further data (like the email template or slack message format). | ||
Unlike previous clients, the new client requires that you pass a separate authenticator. | ||
Example: | ||
```javascript | ||
const authenticator = new FronteggAuthenticator(); | ||
await authenticator.init('<YOUR_CLIENT_ID>', '<YOUR_API_KEY>') | ||
const eventsClient = new EventsClient(authenticator); | ||
const id = await eventsClient.send( | ||
'my-tenant-id', | ||
{ | ||
eventKey: 'my.event', | ||
data: { | ||
description: 'my description', | ||
title: 'my title' | ||
}, | ||
channelConfiguration: { | ||
email: { | ||
from: 'email@email.com', | ||
html: '<div>{{title}}</div>', // data interpolation using the event data | ||
subject: 'subject' | ||
}, | ||
slack: { | ||
emails: ['email@email.com'], | ||
slackMessageConfig: { | ||
// use https://api.slack.com/methods/chat.postMessage data format to fill this configuration | ||
} | ||
} | ||
} | ||
}) | ||
``` | ||
--- | ||
## Usage | ||
@@ -104,5 +147,2 @@ | ||
``` | ||
### Audits | ||
@@ -222,2 +262,2 @@ | ||
})); | ||
``` | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
260
234548
102
3453