Skip to main content
Custom providers let you route push payloads to your own webhook instead of FCM/APNs. Use this page to set up credentials, understand payload shapes, and wire a simple receiver. When to use a custom provider
  • You already have a push gateway (or a third-party) and want CometChat to hand off payloads.
  • You want to enrich or filter notification payloads before delivery.
  • You need to fan out to multiple channels from one webhook.
How delivery works
  • CometChat POSTs one payload per recipient: once for one-on-one, once per member in a group.
  • Your webhook must return 200 OK within ~2 seconds; you handle the actual push delivery.
  • Keep payloads small; respect any rate limits on your infrastructure.

Add custom provider credentials

Custom providers use a webhook URL that receives everything needed to trigger push notifications through your own system.

Prerequisites

  1. An https:// webhook that is publicly reachable and accepts POST JSON.
  2. Respond with 200 OK within 2 seconds; do any heavy work asynchronously.
  3. Secure the endpoint (recommended): Basic Auth or a verified signature. With Basic Auth, send Authorization: Basic <Base64-encoded-credentials>.
  4. Your client should register push tokens with your backend on login and unregister on logout.
  5. For multi-device, map push tokens to the user’s auth tokens so each session can be targeted.

Add credentials

  1. Click on the ”+ Add Credentials” button.
  2. Enable the provider.
  3. Enter the publicly accessible webhook URL.
  4. (Recommended) Enable Basic Authentication.
  5. Enter the username and password.
  6. Save the credentials.

How does it work?

For one-on-one events, the custom provider fires once per recipient. For group events, it fires once per member so you receive one HTTP request per user who should be notified. Example: if a group has 100 members, your webhook receives 100 POSTs—one for each member.

Payload reference

Every request includes trigger: "push-notification-payload-generated" and webhook: "custom". The notification content lives in data.notificationDetails; use that to decide how you deliver the push. Below are sample payloads for different events:

Sample server-side code

Example Express webhook that checks Basic Auth, validates the trigger, and forwards the payload to your push gateway.