-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
How do you keep secrets? #107
Comments
@kevinsimper you can use Hashicorp Vault to store your secret key. |
But I was talking about client/server? How does vault prevent that? |
I think one way of doing it is by setting environment variables. |
That won't work either. You need an api to proxy those requests to github. |
You will need to proxy calls to you server api. |
environment variables should work. |
Would like to reopen this as environment variable will work on the first request, however, navigating using Any workarounds? |
@416serg This is the way to go on that 😄 https://github.com/zeit/next.js/tree/master/examples/with-universal-configuration |
@timneutkens Thanks Tim! I've set that up for it to work, which is awesome, however, I still am worried about passing secret keys to it as when I inspect the page with this structure, I still see the key on client. Example:
Is there anything I can do to avoid exposing the secret key to the client, yet still have the functionality to go back and forth between Thanks again! 😄 |
@416serg the best thing you can do in that case is move the api call into a microservice and call that microservice. Possibly using https://github.com/zeit/micro 👍 |
@timneutkens is there an example where I can see how to connect to a |
@416serg you would simply use https://github.com/zeit/next.js/tree/master/examples/data-fetch |
@416serg I believe you could use browserify transforms (bpb || inline-process-browser) && unreachable-branch-transform (with transform-loader of course, to adapt them for use with webpack) |
@mattbrunetti though that would mean the secret is in the browser. If the browser has the secret, the user has the secret. |
@babenzele The combination is used to strip server-side-only code from your browser build. source: |
@babenzele If you're using a a minifier like uglify i guess that would do the job of the second transform |
If I for example what to use the GIthub API, I don't want to expose my secret? How would I do that?
The text was updated successfully, but these errors were encountered: