REMINDER
how do we install node packages? + how to save app credentials in the env section
-
Hey there guys would be great if you guys could let me know how to install node packages. I have tried looking through a few AWS Lambda tutorials but it's not exactly the same?
When I search I can find the packages I wantI see them on the list and click on them and save, but after that cannot see them in the list of downloaded packages.
Also I tried storing app id + api key in the .env section and it wouldn't save. I hit the + sign and entered the app id hit the + sign a second time and entered my api key and saved, but it just wouldn't save. Might you guys have a tutorial tucked away somewhere?
thanks in advance
Linda -
Hi Linda,
Can you tell us more about what package you tried to install and where ?
You have two ways to do it :1 - Through the library manager by using either the Search or installing with the package name
2 - Build a lambda locally charged with the desired libraries/resources and upload the working Zip file
-
Hey there @Wassim I was trying out the algolia search package, I just used the search bar and found it but do not see a way to enter my own credentials for it? seems like the env section is already preconfigured?
-
@Linda-MacDonald said in how do we install node packages? + how to save app credentials in the env section:
Hey there @Wassim I was trying out the algolia search package, I just used the search bar and found it but do not see a way to enter my own credentials for it? seems like the env section is already preconfigured?
You can add environment variables on your function here :
Then add the desired variables :
Once saved, you can use them in your code :
-
AHH silly me!!!!!!!!!!I cannot enter just APPID and APIKEY again, I need to call it something other than that right? like algoliasearchid...I can just call it whatever? just not appid and apikey? thanks a mil @Wassim
-
Hey, yes you can call it whatever you want as they are just variable names.
You just have to use the same name when using process.env.yourVariable. Your code will use the computed value of it so the name has no impact. (unless a library specifically use inside its code process.env.whateverVariable)