WhatsApp-Clone-Tutorial icon indicating copy to clipboard operation
WhatsApp-Clone-Tutorial copied to clipboard

Step 15 Use environmental variables for the Unsplash API key

Open reymon359 opened this issue 4 years ago • 4 comments

I think it should be a nice thing to explain to the user what are Environmental Variables and how to create and use a .env file in the application and change the current way the Unsplash API key it's used

headers: {
  Authorization:
    'Client-ID 4d048cfb4383b407eff92e4a2a5ec36c0a866be85e64caafa588c110efad350d',
},

EDIT This course is so extensive and full of teachings that I forgot that the .env file is actually explained in Step 3 > Client 3.1 So maybe just create one for the server and add the Unsplash API key to it?

reymon359 avatar May 20 '20 17:05 reymon359

@reymon359 are you up for a PR to change it how you see fit?

Urigo avatar May 28 '20 13:05 Urigo

Sure, I could find some time and work on it!

I was thinking of changing it to:

headers: {
  Authorization:
    `Client-ID ${process.env.UNSPLASH_ACCESS_KEY}`,
},

Although it could also be added in the env.ts file and then import it here.

What do you think?

reymon359 avatar May 29 '20 13:05 reymon359

mmmm not sure, I'll leave it to your call!

Urigo avatar Jun 02 '20 19:06 Urigo

Hi there! Sorry for the late response but I have been quite busy the last weeks. I submitted a pull request #84 to implement it. I tried to change the code too but when I click the submit button I am being redirected to a not working link.

I opened an issue to take it into account #85

Screenshot 2020-06-25 at 20 34 16

Screenshot 2020-06-25 at 20 25 34

reymon359 avatar Jun 25 '20 18:06 reymon359