Skip to content

web-api: expose axios interceptors as WebClient constructor option #2073

@mtjandra

Description

@mtjandra

I'd like to transform outgoing requests from the @slack/web-api package similar to other SDKs such as

This Slack SDK allowa adding additional headers but I require more flexibility. Taking a look at the source it seems it is using axios under the hood (ref). Axios seems to support the concept of interceptors which would support my use case.

I'd like to transform all outgoing requests into POST requests with a body representing the original request, add custom headers, then re-route that to a proxy. Is this possible to configure with the current version @slack/web-api?

If what I'm asking for is not currently possible, is there anything in the works?


Side note: was also thinking we could override the method making the outgoing request (makeRequest), although I'm confused why all outgoing requests are post requests

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions