-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web-api: expose axios interceptors as WebClient
constructor option
#2073
Comments
It may be possible in JavaScript, though you'd have to reach in to the private Alternatively, this could be a new feature request: expose some option on the
Because this project is aimed at interacting solely with the Slack HTTP API, and it is designed to accept POST requests for any HTTP API method you wish to interact with, this is a convenient approach for the API client. See this brief overview in our docs for details, in particular:
|
Hi @filmaj thank you for the reply.
I would like to avoid overriding and/or modifying private methods/variables as it could lead to unexpected behaviour and breaking changes on version updates.
Yes it would be amazing if this could be added as a feature. I'm sure other consumers would benefit from this feature as well. It seems fairly common for SDKs to allow consumers to hook into the request life cycle. |
@slack/web-api
)?WebClient
constructor option
OK, I've set it as a feature / enhancement. We cannot promise any delivery timelines for it. However, if this is something you need, we welcome pull requests! |
Closing and re-opening - this sometimes helps reset the CLA robot. |
I meant to do on the PR, woopsie. Anyways, the CLA check is now resolved. Will review your PR shortly. Thank you for sending it! |
@filmaj any idea on when a new release will be published with these changes? I would love to start making use of it! |
Just released web-api 7.7.0 on npm and as a GitHub Release! |
I'd like to transform outgoing requests from the
@slack/web-api
package similar to other SDKs such asThis 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
The text was updated successfully, but these errors were encountered: