onMessage, a reaction becomes onReaction, a button click becomes onAction. Providers send many more events than that. Platform events let your agent receive any of the others and answer them with the provider’s own API, without running a second webhook endpoint or storing provider tokens.
Use platform events when you need a provider feature Novu has no building block for yet:
- Link unfurling: show a rich preview when someone posts a link to your product.
- Interactive unfurls and modals: handle button clicks inside your own unfurl cards or modal views.
- Slash commands: answer
/your-commandfrom your agent. - Workspace and channel events: welcome new members, react to new or renamed channels.
Platform events are available on Slack today, for agents connected with your own app. They are not available for managed agents or for the shared Novu demo app. If they aren’t enabled for your organization yet, contact Novu support.
How it works
- The provider sends the event to the same endpoint it already uses for your agent.
- Novu verifies the request signature and checks the event type against the allowlist on the agent’s integration. Events that aren’t on the list keep the existing behavior.
- Novu acknowledges the provider at once, looks up the subscriber linked to the user who caused the event, and delivers the event to
onPlatformEventin your bridge. - Your handler calls the provider’s API through
ctx.platformApi. Novu adds the integration’s credentials, so your bridge never holds a provider token.
Choose which events to forward
Forwarding is opt-in, per agent integration. Nothing is forwarded until you list the event types.- Dashboard
- API
- Open the agent in the Novu Dashboard and select its Slack integration.
- In Platform events, add the event types to forward, for example
link_shared. - Click Save.
- Use the provider’s own event type names (
link_shared,team_join,view_submission). - Events Novu already handles, such as
message,app_mentionandreaction_added, can’t be forwarded, so one event never runs two handlers. *forwards every event Novu doesn’t handle. It must be the only entry.- Up to 50 event types per integration.
Handle events
AddonPlatformEvent to your agent. It receives three arguments: the platform the event came from, the event, and a context. Declare ctx only when you call the provider’s API: (platform, event) => … works too.
platform first tells TypeScript which provider’s events you’re handling. event.is(type) then narrows event.payload to the typed shape for that event. Novu ships types for Slack link_shared, block_actions and slash_command; any other event type arrives as a plain record.
The event object
The context object
Platform events aren’t part of a conversation, so the context has noreply or history. It has:
Call the provider’s API
ctx.platformApi calls the provider’s own API through Novu. You choose the method and arguments; Novu picks the host, adds the credentials and returns the provider’s answer unchanged.
call() doesn’t throw when the provider answers with an error such as { ok: false }: check the response the way you would with the provider’s SDK. It throws a PlatformApiError only when Novu refuses the call itself, for example for a blocked method.
Use request() when you need the HTTP status or headers, such as retry-after on a rate limit:
onPlatformEvent, calls run in the workspace the event came from. Outside a handler, for example from a background job, create a client yourself and pass workspaceId when the app is installed in more than one workspace:
POST /v1/agents/{agentIdentifier}/integrations/{integrationIdentifier}/platform-api with your secret key.
Guardrails
- Calls are scoped to the environment of the secret key and to integrations connected to the agent.
- Methods that change the installation itself are blocked, such as Slack
oauth.*,admin.*,apps.uninstallandauth.revoke. - Requests are limited to 1 MB, responses to 5 MB, and each call to 10 seconds.
- Novu logs the method, path, status and latency of every call, never the bodies.
Delivery
- Novu acknowledges the provider before it calls your bridge, so slow handlers never make the provider retry.
- Each event is delivered once. Provider retries of the same event are dropped for 10 minutes.
- Failed deliveries aren’t retried, and events can arrive in any order.
- An error thrown in
onPlatformEventis logged by the bridge and doesn’t affect other handlers. - An agent without
onPlatformEventignores forwarded events.
view_submission that returns validation errors. Novu has already answered the provider by the time your handler runs, so use the provider’s API (for example views.update) or the interaction’s response_url instead.
Related
Slack platform events
Setup, link unfurling and other Slack examples.
Handlers and context
The handlers Novu runs for conversation events.