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

Public environment variables #10

Open
ollebergkvist opened this issue Nov 11, 2022 · 0 comments
Open

Public environment variables #10

ollebergkvist opened this issue Nov 11, 2022 · 0 comments

Comments

@ollebergkvist
Copy link

ollebergkvist commented Nov 11, 2022

Using publicly exposed environment variables for the access token and store domain is not a good idea as they will be included in the build and are easily accessed by the client.

Hence, createCheckout and updateCheckout in src/lib/shopify.ts should be moved to api routes as they are run client-side.
The other queries are run server-side (getStaticProps), so they can utilize env variables.

Maybe that was mentioned in the course, but I believe a lot of people might use this project as a starting template. So maybe it's important to mention it somewhere in the readme.

Great material otherwise, I learned a lot from just exploring the repo.

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

1 participant