- Open your web browser
- Go to: https://aistudio.google.com/apikey
- You'll see the Google sign-in page
- Click "Use your Google Account"
- Enter your email or phone number
- Enter your password
- Complete any 2-factor authentication if prompted
- Once signed in, you'll see the Google AI Studio dashboard
- Look for "Create API Key" button (usually in the top right or center)
- Click "Create API Key"
- Choose your Google Cloud project (or create a new one)
- Click "Create API Key in new project" if you don't have one
- Your API key will be generated (it looks like:
AIzaSyC...) - IMPORTANT: Copy this key immediately - you won't be able to see it again
- Save it in a secure location
- Open the file:
src/config/apiConfig.js - Find this line:
export const GEMINI_API_KEY = 'YOUR_GEMINI_API_KEY_HERE';
- Replace
YOUR_GEMINI_API_KEY_HEREwith your actual API key:export const GEMINI_API_KEY = 'AIzaSyC_your_actual_key_here';
- Save the file
- Start your React Native app:
npm start - Send a test message in the chat
- You should receive an AI response
"API request failed: 403"
- Check if your API key is correct
- Ensure you've enabled the Gemini API in Google Cloud Console
"API request failed: 400"
- Verify the API key format
- Check if you have proper permissions
"Invalid API response format"
- API key might be incorrect
- Check your internet connection
- Never share your API key publicly
- Don't commit the API key to version control
- Consider using environment variables for production
- Free tier has usage limits
- Monitor your usage in Google AI Studio
- Consider upgrading if you need higher limits
- ✅ Copy your API key
- ✅ Update
src/config/apiConfig.js - ✅ Test the app
- ✅ Verify safety features work
- ✅ Test emergency detection
Once you have your API key and have updated the configuration file, let me know and I can help you test the app or make any additional improvements!