r4ds / shinyslack

Integrate Slack and Shiny
Other
15 stars 3 forks source link

Key as arg #52

Closed jonthegeek closed 6 months ago

jonthegeek commented 6 months ago

Add slack_api_key to args of all functions that include slackcalls::post_slack() (and then use that, rather than the default).

.validate_cookie_token() currently uses Sys.setenv() to set the SLACK_API_TOKEN. That MUST, instead, just use the token in that single app.

Something server-side needs to make the cookie token available. In theory we can put it in session$userData without the user having to know about it. And then all of the shinyslack functions can look there by default for the key, something like this maybe?

session = shiny::getDefaultReactiveDomain(), api_key = session$userData$shinyslack_api_key