Yeah, for API keys I recommend creating something like Secrets.elm and adding that file to .gitignore. Locally, developers have to create that file as part of setting up their systems, and then you have your build process swap in a different file (containing different constants) for production builds.
This way you can easily access the secrets from any module, and if you forget to set them up locally, you'll get a compile error because the module won't be found!
I do this with the Frontend Masters workshop for GitHub API access tokens; you can check out the repo here github.com/rtfeldman/elm-workshop
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah, for API keys I recommend creating something like
Secrets.elm
and adding that file to.gitignore
. Locally, developers have to create that file as part of setting up their systems, and then you have your build process swap in a different file (containing different constants) for production builds.This way you can easily access the secrets from any module, and if you forget to set them up locally, you'll get a compile error because the module won't be found!
I do this with the Frontend Masters workshop for GitHub API access tokens; you can check out the repo here github.com/rtfeldman/elm-workshop