Skip to content
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

Possible docs issue #25

Open
GHkrishna opened this issue Nov 4, 2024 · 3 comments
Open

Possible docs issue #25

GHkrishna opened this issue Nov 4, 2024 · 3 comments

Comments

@GHkrishna
Copy link

What

Currently the docs mentions:

In development, the dev.ts script will be used which will automatically set up an ngrok tunnel for you and start the mediator agent with some default values. There's no need to configure any environment variables.

However, in development mode, ngrok gives an access error until a token is set.

void connect({
port,
authtoken: 'your-token'
}).then((app) => {

Could this be a possible issue for starting the mediator in development, Or am I missing something?

@TimoGlastra
Copy link
Member

Yes, ngrok has changed how you can use their sdk and tools.

I usually now use the ngrok cli (ngrok http 3001) and then set the env variable.

@GHkrishna
Copy link
Author

Okay, will try it out 👍

@GHkrishna
Copy link
Author

GHkrishna commented Nov 6, 2024

Yes, ngrok has changed how you can use their sdk and tools.

I usually now use the ngrok cli (ngrok http 3001) and then set the env variable.

I tried this approach but, only yarn start would work and not yarn dev

As mentioned, I've started ngrok and provided the appropriate AGENT_ENDPOINTS= and INVITATION_URL= and yarn dev would still bug us about the ngrok authentication error

yarn dev
yarn run v1.22.19
$ ts-node dev
[Error: failed to connect session: Usage of ngrok requires a verified account and authtoken.
Sign up for an account: https://dashboard.ngrok.com/signup
Install your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken error_code: ERR_NGROK_4018] {
  code: 'GenericFailure',
  errorCode: 'ERR_NGROK_4018'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is because, we try to connect to ngrok with yarn dev

I think it would be better to either,

  1. add NGROK_AUTH_TOKEN to .env and make appropriate change or
  2. In dev mode avoid connecting to ngrok and set the below mentioned in dev.ts directly. Also make AGENT_ENPOINTS= compulsory,
// dev.ts
process.env.NODE_ENV = 'development'
process.env.AGENT_PORT = `${port}`
process.env.SHORTENER_BASE_URL = `${process.env.AGENT_ENDPOINTS?.split(',')[0]}/s`

Let me know what you think, I will create a PR accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants