WebhookSubscription

Value object returned by AWebhookApplication (or any class implementing IWebhookApplication) from getWebhookSubscriptions(). Each instance describes one event the Application can advertise in the editor's webhook picker.

import WebhookSubscription from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Webhook/WebhookSubscription';

WebhookSubscription.create(name, parameters?, description?) #

Canonical factory for declaring webhook events. Use it for every new subscription.

ParameterTypeDefaultPurpose
namestringrequiredEvent identifier — typically the upstream provider's event name (order.created, contact.updated). The platform uses this together with the application name to build the canonical webhook node name <application>.<event>.
parametersRecord<string, unknown>{}Default parameters merged with whatever the user types in the Subscribe modal. Persisted on the WebhookConfig and replayed on re-subscribe.
descriptionstring''Short, human-readable description of the event. Shown next to the event name in the editor's webhook picker — keep it punchy.
public getWebhookSubscriptions(): WebhookSubscription[] {
    return [
        WebhookSubscription.create('order.created', { source: 'my-app' }, 'Fired when a new order is placed'),
        WebhookSubscription.create('order.updated', {}, 'Fired on order status / item changes'),
        WebhookSubscription.create('ping'),
    ];
}

Legacy constructor #

new WebhookSubscription(name: string, node: string, topology: string, parameters?: Record<string, unknown>)

Still works — the SDK accepts both forms — but node and topology are now ignored: the platform always reads them from WebhookConfig (set by the user in the editor) instead of trusting any value declared in code. node and topology are marked @deprecated and exist solely so older Applications keep compiling without changes.

Pass '' for node and topology if you have to keep using the legacy constructor for some reason. Don't try to compute a "default" topology / node — those values are owned by the UI now.

Fields #

FieldTypePurpose
namestringCanonical event name.
parametersRecord<string, unknown>Default parameters; merged with the Subscribe-modal values at subscribe time.
descriptionstringEditor-picker description.

See also #

© 2025 Orchesty Solutions. All rights reserved.