A lightweight Chrome Extension powered by JavaScript that communicates with a local server using the Gemini API.
- Node.js installed
- A valid Gemini API key from Google AI Studio
- Chrome browser
git clone https://github.com/your-username/your-extension-repo.git
cd your-extension-repo
cd server
npm install
Create a .env
file in the server
directory:
touch .env
Add this line inside .env
:
GEMINI_API_KEY=your_api_key_here
npm start
This will start your server on the default port (e.g., http://localhost:3000
).
- Open Chrome and navigate to
chrome://extensions/
. - Enable Developer Mode (top right toggle).
- Click on Load unpacked.
- Select the
extension
folder from this project.
- Navigate to a supported page (e.g., LeetCode).
- Click the extension icon in the toolbar.
- The extension will interact with your local server using your Gemini API key.
📁 extension/
📁 server/
├─ .env
├─ index.js
└─ ...
Use a tool like Postman
or cURL:
curl -X POST http://localhost:3000/gemini \
-H "Content-Type: application/json" \
-d '{"prompt": "Summarize this paragraph..."}'
- Keep your
.env
file private. - Ensure the server is running before using the extension.
- Chrome extension requests are routed to the local server.