beginner-corp / slack

:tada:✨ Slack API client for Node and browsers.

Home Page:https://www.npmjs.com/package/slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

usage with steno

danprince opened this issue · comments

It'd be great to be able to use this package with Steno (Slack's API scenario recording tool).

The basic workflow is to run Steno then start sending API requests to the local port that it's running on, allowing it to log them and forward them on to Slack.

The only thing which prevents this at the moment is that the URL is hardcoded into _exec.js.

https://github.com/smallwins/slack/blob/d403bc280a75bcb5c50b827d98a8e0b8cba7f370/src/_exec.js#L36-L43

Could allow overriding that URL with an environment variable? But I guess that's not going to help browser users much.

Could also accept an overridden URL through the method params like tokens are.

Happy to open up a PR if you know how you'd like to see this implemented.

Yes, this is a great idea and keeping aligned with Slack ecosystem tooling is an important goal.

I hesitate to change the methods signature for this particular use case. But I really like env vars to know if we are in a testing state. If we use NODE_ENV=testing this will be a seamless experience for most Node based projects.

Means we would need a special browser build for testing code. Could use envify for that which should be pretty easy. I’ve been intending to publish standalone browser builds but haven’t gotten around to it. Something like:

  • slack-9.0.0.js
  • slack-9.0.0.min.js
  • slack-testing-9.0.0.js
  • slack-testing-9.0.0.min.js

PR would be super appreciated!

💯 💕