-
Copy the Apps Script code:
- Open
apps-script/Code.gs - Copy all the code
- Open
-
Create Apps Script project:
- Go to https://script.google.com/
- Click "+ New project"
- Paste the code
- Update
FOLDER_IDwith your Drive folder ID - (Optional) Update
SHEET_IDfor order logging
-
Deploy as Web App:
- Click "Deploy" → "New deployment"
- Select "Web app"
- Execute as: "Me"
- Who has access: "Anyone"
- Click "Deploy"
- Copy the Web App URL
Create .env.local in your project root:
APPS_SCRIPT_WEB_APP_URL=https://script.google.com/macros/s/YOUR_WEB_APP_ID/execReplace YOUR_WEB_APP_ID with the ID from your Web App URL.
-
Start the dev server:
npm run dev
-
Upload a test file:
- Go to http://localhost:3000
- Click "Start Printing Now"
- Upload a file
- Complete the order flow
-
Check your Drive folder:
- Files should appear in your configured Drive folder
- (If enabled) Check your Google Sheet for order logs
Your PrintX app is now connected to Google Drive via Apps Script.
Files not uploading?
- Check that
APPS_SCRIPT_WEB_APP_URLis set correctly - Verify the Apps Script is deployed and accessible
- Check browser console for errors
403/401 errors?
- Make sure Apps Script is deployed with "Anyone" access
- Re-authorize the Apps Script if needed
Files not in Drive?
- Verify the
FOLDER_IDis correct - Check Apps Script execution logs in the Apps Script editor
- Test with multiple files
- Check order logs in Google Sheet (if enabled)
- Deploy to Vercel for production