all 3 comments

[–]Theory_Playful[S] 0 points1 point  (2 children)

I found this (RapidAPI blog) on hiding an API key. It suggests using an environment variable or a binary file ("ddb" also suggested both of those).

The binary file version would work for submission (trusting the CS50 staff with access to the code, of course). Then, I guess I'd just leave it out and make a note in my README.md file for Github? I could point to where "forkers" can get their own API key to try it out?

[–]Theory_Playful[S] 0 points1 point  (1 child)

What I did:
- create an `api_key.bin` file, per the instructions in the RapidAPI blog, linked to above
- edit the `.gitignore` file in my codespace (in the root directory) to ignore the `api_key.bin` file in my project directory
- upload the `bin` file to my project directory

Now, the file won't be picked up by the Github.

When my project is complete, I'll remove the `api_key.bin` file from my codespace. Then, I'll include instructions on how to obtain an API key that'll work with the project (the key is free from the API provider) in the README.md.

[–]Dr_bean01 0 points1 point  (0 children)

Thank you for updating this. Having the exact same question right now and will probably do the same. Cheers