Use the following API endpoint to generate a token for subscribing to the notification channel:
api/mercure/token/{companyId}|{userId}
Once you have the token, subscribe to the channel using the following URL:
.well-known/mercure?topic=/notifications/{companyId}|{userId}
For frontend integration, you can use the EventSource library. As a response, you will receive a JSON object in the following format:
{
"id": notificationId(),
"status": "created"
}