Notifications
Get notified about events happening in Openfort or on-chain.
Why use notifications?#
When building Openfort integrations, you might want your applications to receive events as they occur in your Openfort accounts, so that your backend systems can execute actions accordingly.
You can configure notifications via the API to be notified about events that happen in your Openfort account or on-chain.
By default, Openfort will send a notification to the specified subscriptions every 24 hours.
Create a notification#
Notification objects are the core of the notification system. They define the name of the notification and encapsulate both the trigger and subscriptions.
Create a trigger#
Triggers define the condition that will trigger the notification.
There are 3 available triggers:
- Project balance trigger: Define a threshold balance of credits in your project. This is useful to control you can continue to sponsor gas fees for your users.
- Contract balance trigger: Check for the returned parameter of a contract call and compare it to a threshold. This is useful to control the deposited amount in a paymaster contract.
- Developer account balance trigger: Check for the balance of a developer account and compare it to a threshold. This is useful when you're using a developer account itself is paying for the gas fees of the transactions it puts on-chain.
There can be more than one notification trigger per notification.
Create a subscription#
Subscriptions define the method and target of the notification.
There are 3 available subscription methods:
- Email: Send an email to the specified target.
- Webhook: Send a POST request to the specified target. To learn more about receiving webhooks, check out the webhooks guide and the types
notification.developer_account.balance
,notification.contract.balance
ornotification.project.balance
.
There can be more than one notification subscription per notification.