Skip to main content

Managing App Webhooks

Ductape allows product teams to manage webhooks registered by apps using the ductape.products.webhooks interface. This enables a product to track and control how its apps integrate webhooks across environments.

Overview

ductape.products.webhooks

fetchAll

Fetch all webhooks registered by an app using its accessTag.

const webhooks = await ductape.products.webhooks.fetchAll("my-access-tag");

Parameters

NameTypeDescription
accessTagstringThe unique access tag for the target app

Returns

Returns an array of registered webhooks associated with the given access tag.

enable

Register or activate a webhook for a specific product and app in a given environment.

const result = await ductape.products.webhooks.enable({
product: "my-product",
access_tag: "my-access-tag",
webhook_tag: "new-webhook",
envs: [
{
slug: "prd",
url: "https://webhooks.target.com/register",
method: HttpMethods.POST,
auth: {
headers: {
Authorization: "Bearer mytoken"
},
query: {},
body: {},
params: {}
}
}
]
});

Parameters

NameTypeDescription
productstringThe product slug
access_tagstringThe app's access tag
webhook_tagstringThe tag of the webhook being registered
envsIProductBuilderRegisterWebhookEnvs[]Environment-specific webhook configurations

IProductBuilderRegisterWebhookEnvs

FieldTypeDescription
slugstringEnvironment slug (prd, snd, etc.)
urlstringWebhook registration URL
methodHttpMethodsHTTP method used (POST, GET)
authIActionRequestAuthentication and request structure

Generate a Ductape link for a webhook in a specific environment. This is used when the app provides its own link and the product wants to wrap it in a Ductape-generated tracking URL.

const link = await ductape.products.webhooks.generateLink({
product: "my-product",
access_tag: "my-access-tag",
webhook_tag: "new-webhook",
env: "prd",
url: "https://webhooks.target.com/register",
method: HttpMethods.POST
});

Parameters

NameTypeDescription
productstringThe product slug
access_tagstringThe access tag of the app
webhook_tagstringThe tag of the webhook being linked
envstringThe environment slug
urlstringThe original URL to be wrapped
methodHttpMethodsThe HTTP method (POST, GET, etc.)

Returns

Returns a Ductape-generated link that the app can use for webhook registration.