1. Course intro
The first video introduces the course, project template, and final result. We will learn how to create a Gemini API key and discuss restricting the API key and keeping it safe.
Pre-requisites
Here are the pre-requisites for this course
- Basic command line experience (
git
andnpm
). - Beginner to intermediate experience with JavaScript.
- Familiar with promises (and
async/await
). for...of
(optional).
Check out this JavaScript knowledge map to brush up on JavaScript.
Create an API key
To create an API key, head over to Google's AI studio: aistudio.google.com
While we use the API key directly in the code in this demo, this is not recommended outside the context of a demo.
Restricting your API Key
After you create your API Key, we recommend that you click on the arrow next to its name to add restrictions. This is done in the Google Cloud Console.
You can specify restrictions based on IP address, referral header, or restrictions specific to an Android or iOS app.
localhost
.Set up the demo project
To set up the demo project, click the download button at the top of this page. Then, extract the zip file and open it in your terminal.
Once you're inside the project, run the following commands to install the node dependencies and run the local dev server:
npm install
npm run dev