Skip to content

feat(webhook): export addAppMetadata from @slack/webhook #2614

@zimeg

Description

@zimeg

Summary

@slack/webhook v8 has an internal addAppMetadata function in src/instrument.ts that allows prepending custom app identity to the User-Agent header. However, it is not exported from the package's public API (src/index.ts).

@slack/web-api exports addAppMetadata publicly, allowing downstream tools to register themselves for instrumentation. The webhook package should do the same for consistency.

Use case

In slack-github-action, we want to register the action's name and version so Slack can see which tool is making webhook requests:

import { addAppMetadata } from "@slack/webhook";

addAppMetadata({ name: "@slack/slack-github-action", version: "3.0.3" });

Currently we work around this by injecting a custom User-Agent via the fetch option, but having the public export would be cleaner and consistent with web-api.

Proposed change

Export addAppMetadata from packages/webhook/src/index.ts:

export { addAppMetadata } from './instrument.js';

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementM-T: A feature request for new functionalitypkg:webhookapplies to `@slack/webhook`

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions