@frontegg/client
Advanced tools
Comparing version 1.0.42 to 1.0.43-0
@@ -6,2 +6,3 @@ import { AuditsClient } from './src/audits'; | ||
import { TenantsClient } from './src/tenants'; | ||
export { AuditsClient, NotificationsClient, TenantsClient, frontegg, FronteggPermissions, IFronteggOptions, }; | ||
import { FronteggAuthenticator } from './src/authenticator'; | ||
export { AuditsClient, NotificationsClient, TenantsClient, frontegg, FronteggPermissions, IFronteggOptions, FronteggAuthenticator, }; |
@@ -13,1 +13,3 @@ "use strict"; | ||
exports.TenantsClient = tenants_1.TenantsClient; | ||
var authenticator_1 = require("./src/authenticator"); | ||
exports.FronteggAuthenticator = authenticator_1.FronteggAuthenticator; |
@@ -17,4 +17,4 @@ export declare class NotificationsClient { | ||
body?: string; | ||
url?: string; | ||
severity?: string; | ||
url?: string; | ||
actions?: INotificationAction[]; | ||
@@ -21,0 +21,0 @@ expiryDate?: Date; |
@@ -6,2 +6,3 @@ import { AuditsClient } from './src/audits'; | ||
import { TenantsClient } from './src/tenants'; | ||
import { FronteggAuthenticator } from './src/authenticator'; | ||
@@ -15,2 +16,3 @@ export { | ||
IFronteggOptions, | ||
FronteggAuthenticator, | ||
}; |
{ | ||
"name": "@frontegg/client", | ||
"version": "1.0.42", | ||
"version": "1.0.43-0", | ||
"description": "Frontegg Javascript Library for backend", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -124,2 +124,38 @@ # Frontegg Client | ||
``` | ||
### Notifications | ||
Allow your customers to be aware of any important business related event they need to pay attention to, both in the dashboard and even when offline. | ||
Frontegg’s Managed Notifications feature allows a SaaS company to embed an end-to-end working feature in just 5 lines of code. | ||
#### Sending notifications | ||
```javascript | ||
import { NotificationsClient } from '@frontegg/client' | ||
const notificationsClient = new NotificationsClient(); | ||
// First initialize the module | ||
await notificationsClient.init('YOUR-CLIENT-ID', 'YOUR-API-KEY'); | ||
// Set the notification you want to send | ||
const notification = { | ||
"title": "Notification Title", | ||
"body": "Notification Body", | ||
"severity": "info", | ||
"url": "example.com" // url to be opened when user clicks on the notification | ||
} | ||
// send the notification to a specific user | ||
await notificationsClient.sendToUser('RECEPIENT-USER-ID', 'RECEPIENT-TENANT-ID', notification) | ||
// send the notification to all tenant users | ||
await notificationsClient.sendToTenantUsers('RECEPIENT-TENANT-ID', notification) | ||
// send the notification to all users | ||
await notificationsClient.sendToAllUsers(notification) | ||
``` |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
71119
1433
160
3