Code Monkey home page Code Monkey logo

Comments (3)

swyxio avatar swyxio commented on July 26, 2024 5

yup, thats about it!

i'll be honest that i havent precisely done this myself because i havent needed to but this is exactly how it would work in theory. if you try it and run into any problems (including security concerns), please report here and i'll do my best to help you research/resolve.

we have more on this i can't talk about coming soon - stay tuned

from netlify-faunadb-example.

swyxio avatar swyxio commented on July 26, 2024

thanks for your concern!

env vars can have contexts - https://www.netlify.com/docs/continuous-deployment/#deploy-contexts

so just be sure that your prod stuff is in a prod context and your deploy preview stuff is in a different one.

pretty neat huh!

from netlify-faunadb-example.

egardner avatar egardner commented on July 26, 2024

Thanks, @sw-yx – we figured Netlify had set up some way to avoid this problem, just weren't sure what it was.

It sounds like a good practice for a public project that talks to an API would be to do the following:

  • Create a dummy account for whatever service is being used (Airtable in this case)
  • Put the access key for that account into netlify.toml in [context.deploy-preview.environment]. This will be exposed in the repo for all to see, but it's only dummy data
  • Keep the production access key in the Netlify admin; users who deploy their own copy of the app to their own Netlify instance will have to provide their own production data (their own Airtable account or whatever).

Is there anything I'm overlooking here? Thanks again!

from netlify-faunadb-example.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.