Closed sinofseven closed 8 months ago
Hello, thanks for your feedback! There would be a way to inject the authtoken using the environment variable on the command line, as long as authtoken_from_env: true
is set, with something like:
NGROK_AUTHTOKEN=`grep authtoken $HOME/.config/ngrok/ngrok.yml | awk '{print $2}'` node ngrok-forward-minimal.js
While there's no automatic method, it's also possible to write code grab the authtoken from that file and set it with authtoken: token
in forward(), or ngrok.authtoken(token) to use it by default for all forward() calls, or using the authtoken(token) method on the SessionBuilder (if using the builders for configuration).
The CLI reads from the configuration file without doing anything special.
We would like to change this in the SDK as well.
What are the pros and cons of making changes to the SDK?
Hi, sorry for the delay in responding. The ngrok.yml
is a configuration file specifically for the ngrok Agent, and isn't slated to be part of how the SDK's are configured. We know there is a desire to have something like this so there have been discussions around the future of configuration. For now using the environment variable or adding code to the project is the way to get the authtoken in to the SDK. Thank you for your feedback!
I understand. Thank you very much.
I use authtoken listed in
$HOME/.config/ngrok/ngrok.yml
in CLI.I would like to use authtoken listed in
$HOME/.config/ngrok/ngrok.yml
. Currently it doesn't seem to work, What do you think?