A React app that connects to your Gmail, finds order confirmation emails, and helps you track return deadlines using AI-powered policy lookups.
- Gmail Integration - Connects via Google OAuth to scan your inbox for order emails
- Automatic Order Detection - Identifies purchases from retailers like Amazon, Target, Best Buy, H&M, ASOS, and more
- AI-Powered Policy Search - Uses ChatGPT to look up return policies for each retailer
- Deadline Tracking - Calculates return windows and highlights urgent deadlines
- Chat Interface - Ask questions like "What returns are closing soon?" or "What's my Target return window?"
- Node.js (v16 or higher)
- npm
- OpenAI API key
- Google Cloud project with Gmail API enabled
git clone https://github.com/htaswell/gmail-return-assistant.git
cd gmail-return-assistant
npm installCopy the example environment file:
cp .env.example .env.localEdit .env.local and add your credentials:
REACT_APP_OPENAI_KEY=sk-your-actual-openai-key
REACT_APP_GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable the Gmail API
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Choose Web application
- Add authorized JavaScript origins:
http://localhost:3000(for development)- Your production URL (for deployment)
- Copy the Client ID to your
.env.local
npm startOpen http://localhost:3000 in your browser.
- Enter your OpenAI API key (if not set in environment)
- Click Connect Gmail and authorize access
- The app will scan for order emails and look up return policies
- Ask questions in the chat like:
- "What returns do I have?"
- "Which deadlines are coming up?"
- "How long do I have to return my Amazon order?"
- Push your code to GitHub (make sure
.env.localis in.gitignore) - Connect your repo to your hosting platform
- Add environment variables in the platform's dashboard:
REACT_APP_OPENAI_KEYREACT_APP_GOOGLE_CLIENT_ID
- Update Google OAuth authorized origins to include your production URL
- React
- Tailwind CSS
- Google Identity Services (OAuth)
- Gmail API
- OpenAI GPT-4 API
- Never commit
.envor.env.localfiles - API keys should only be stored in environment variables
- The app only requests read-only Gmail access
MIT