Overview
The Shopify RSS Feed to Google Chat service is designed to run as a serverless function with scheduled cron jobs. This guide covers deployment to Vercel, which provides native support for cron-triggered functions.The service uses Vercel’s cron functionality to automatically check for Shopify changelog updates daily at midnight UTC.
Prerequisites
Before deploying, ensure you have:Google Chat Webhook
A Google Chat webhook URL where updates will be sent. See Environment Variables for setup instructions.
Vercel Account
A free or paid Vercel account at vercel.com
Cron Schedule Configuration
The service is configured to run on a daily schedule using Vercel’s cron jobs feature.Current Configuration
Fromvercel.json:
Schedule Breakdown
The cron expression that defines when the job runs.Current Schedule:
0 0 * * *- Runs daily at midnight UTC (00:00)
- Checks for new Shopify changelog entries
- Sends updates to Google Chat if new items are found
The API endpoint that Vercel will call when the cron job triggers.This path is defined in
server.ts:10-13:Custom Schedule Examples
To modify the schedule, updatevercel.json with a different cron expression:
- Every 6 Hours
- Twice Daily
- Weekdays Only
- Every Hour
Check for updates four times per day:Runs at: 00:00, 06:00, 12:00, 18:00 UTC
Deploy to Vercel
Option 1: Deploy with GitHub (Recommended)
Import project to Vercel
- Log in to vercel.com
- Click Add New → Project
- Import your GitHub repository
- Select the repository containing your code
Configure environment variables
In the import configuration screen:
- Expand Environment Variables
- Add
WEBHOOK_URLwith your Google Chat webhook URL - Select Production, Preview, and Development environments
Configure build settings
Vercel should automatically detect the project settings:
- Framework Preset: Other
- Build Command: (leave empty or use
bun install) - Output Directory: (leave empty)
- Install Command:
bun install
If Bun is not detected, you may need to specify the Node.js version or install command manually.
Option 2: Deploy with Vercel CLI
Set environment variables
Option 3: One-Click Deploy Button
Add a deploy button to your README.md for easy deployment:Replace
YOUR_USERNAME/YOUR_REPO with your actual GitHub repository path.- Clone the repository to their account
- Prompt for the
WEBHOOK_URLenvironment variable - Deploy the service automatically
Project Structure
The deployment includes these key files:Server Configuration
Fromserver.ts:
/healthcheck- Returns “Running!” to verify the service is alive/get-rss-feed- Triggered by cron to check for and send updates
Verifying Deployment
Check Deployment Status
View deployment logs
- Open your Vercel dashboard
- Navigate to your project
- Click on the latest deployment
- View the Deployment Logs tab
Manually trigger the cron
Test the RSS feed endpoint manually:Expected response:Check your Google Chat space for incoming messages.
Monitor Cron Executions
Cron jobs on Vercel run automatically at the scheduled time. You cannot manually trigger them through the dashboard.
- Navigate to Logs in your Vercel project
- Filter by function:
/get-rss-feed - Look for execution logs around midnight UTC daily
Environment-Specific Deployments
Production
Production deployments use themain or master branch and production environment variables.
Preview (Staging)
Preview deployments are created for non-production branches:Development
Local development uses the.env file for environment variables:
- Healthcheck:
http://localhost:3000/healthcheck - RSS Feed:
http://localhost:3000/get-rss-feed
Updating Environment Variables
To update environment variables after deployment:Edit variable
- Find
WEBHOOK_URL - Click Edit
- Update the value
- Select environments (Production, Preview, Development)
- Click Save
Rollback and Version Control
Rollback to Previous Deployment
If a deployment fails or causes issues:Git-Based Rollback
Troubleshooting
Cron job not executing
Symptoms:- No logs appearing at scheduled time
- Google Chat not receiving updates
- Verify cron is registered in Settings → Crons
- Ensure deployment is in production (preview deployments don’t run crons)
- Check that
vercel.jsonis in the project root - Review cron syntax is valid (use crontab.guru to verify)
Build failures
Common causes:- Missing dependencies in
package.json - TypeScript compilation errors
- Missing environment variables during build
- Review build logs in Vercel dashboard
- Test build locally:
bun run build(if build script exists) - Ensure all imports use
.jsextensions for Bun compatibility - Verify TypeScript configuration in
tsconfig.json
Function timeout
Symptoms:- Deployment logs show timeout errors
- 504 Gateway Timeout responses
- Optimize RSS parsing logic
- Add timeout configuration to
vercel.json: - Consider upgrading to Vercel Pro for longer execution limits
Environment variables not loading
Symptoms:- Error: “WEBHOOK_URL environment variable is not set”
- Variables work locally but not in production
- Verify variables are set in Settings → Environment Variables
- Ensure correct environment (Production/Preview/Development) is selected
- Redeploy after adding variables
- Check variable names match exactly (case-sensitive)
Cost Considerations
Vercel Hobby Plan (Free)
- Executions: Unlimited
- Execution Duration: 10 seconds per function
- Bandwidth: 100 GB/month
- Cron Jobs: Limited to daily frequency
Vercel Pro Plan
If you need more frequent updates:- Execution Duration: 60 seconds per function
- Bandwidth: 1 TB/month
- Cron Jobs: Up to 100 per day
- Cost: $20/month per member
For this lightweight RSS service, the free Hobby plan is typically sufficient unless you need more frequent update checks.
Security Best Practices
-
Protect Environment Variables
- Never commit
.envfiles to Git - Add
.envto.gitignore - Use Vercel’s encrypted environment variable storage
- Never commit
-
Webhook Security
- Keep webhook URLs private
- Rotate webhooks periodically
- Monitor webhook usage in Google Chat
-
Access Control
- Limit who can access your Vercel project
- Use Vercel Teams for shared projects
- Enable two-factor authentication on your Vercel account
-
Monitoring
- Set up alerts for deployment failures
- Monitor function execution logs
- Track error rates and investigate anomalies
Next Steps
After successful deployment:- Monitor your Google Chat space for incoming Shopify changelog updates
- Adjust the cron schedule if needed based on your team’s preferences
- Customize the message format in
rss-handler.tsfor your needs - Set up deployment notifications in Vercel (Settings → Notifications)
The first cron execution will happen at the next scheduled time (midnight UTC by default). You can manually trigger
/get-rss-feed to test immediately.