NorbixWebhookReceiver class

Inbound Norbix webhook receiver.

Verifies the HMAC signature, parses the envelope, normalises the payload, and dispatches to per-event handlers.

final receiver = NorbixWebhookReceiver(); // reads env

receiver.on<UserDto>(NorbixWebhookEvents.membershipUserRegistered, (user, event) {
  print(user.email ?? user.userName);
  print(event.metadata.user?.id);
});

receiver.onAll(kNorbixWebhookEventNames, (envelope, ctx) => log(envelope.event));

final result = await receiver.handle(rawBody: body, headers: headers);

Constructors

NorbixWebhookReceiver({String? secret, int? toleranceSeconds, String? projectId, String? accountId})
Any argument left null falls back to its env var: NORBIX_WEBHOOK_SIGNING_SECRET, NORBIX_WEBHOOK_TOLERANCE_SECONDS, NORBIX_PROJECT_ID, NORBIX_ACCOUNT_ID.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

handle({required String rawBody, required Map<String, String> headers, String? path, bool verify = true}) Future<WebhookHandleResult>
Verify (when a secret is configured), parse, normalise, and dispatch.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<T>(String event, NorbixWebhookHandler<T> handler) → void
Register the typed handler for one event. The payload is cast to T.
onAll(List<String> events, NorbixWebhookRawHandler handler) → void
Register a raw handler for many events. Runs after on for each event.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited