# WebhookUrl

`function` in `core` · v0.14.0

<https://seedcord.org/docs/packages/core/0.14.0/functions/webhook-url>

Declares where a [`WebhookLog`](/docs/packages/core/0.14.0/classes/webhook-log) reporter reads its webhook url.

A string is the name of an environment variable. A function returns the url, which lets you read it from any
module of yours. If the variable is unset or the function returns `undefined`, the reporter will be off and the
bot will warn at boot. A url that isn't a Discord webhook url throws at boot.

```ts
WebhookUrl(
    source: string | (() => string | undefined)
): <Keys extends SubscriptionKey>(
    constructor: Constructor<WebhookLog<Keys, CoreBase>>
) => void
```

Declares where a [`WebhookLog`](/docs/packages/core/0.14.0/classes/webhook-log) reporter reads its webhook url.

A string is the name of an environment variable. A function returns the url, which lets you read it from any
module of yours. If the variable is unset or the function returns `undefined`, the reporter will be off and the
bot will warn at boot. A url that isn't a Discord webhook url throws at boot.

Parameters.

- `source` `string | (() => string | undefined)` — The environment variable that holds the url, or a function that returns it

Returns `<Keys extends SubscriptionKey>(constructor: Constructor<WebhookLog<Keys, CoreBase>>) => void`.
