SERVICES
WORKBLOGABOUT US

How to Automate Expo Previews 🚀

🥳📱 What If Expo Previews Were as Seamless as Vercel Deployments? 🫰
 
If you’ve ever used Vercel’s Preview Deployments, you know how magical it feels: open a PR, and boom—a live URL is ready to share. No manual deployments, no waiting around.
 
notion image
 
Wouldn’t it be great if we had something just as seamless for Expo mobile apps?
 
That’s exactly what we built. With a simple GitHub Action, every PR now automatically generates an Expo QR Code, allowing you to preview changes instantly on your phone—just like Vercel!
 
And the best part? It takes less than a minute to set up!
 
Let’s dive in. 👇

🔧 Step 1: Add the Required Secrets to GitHub

To make this work, we need two tokens to authenticate with Expo and GitHub.

1️⃣ Create a GitHub Personal Access Token (GH_PAT)

  1. Go to GitHub Personal Access Tokens
  1. Click "Generate new token (classic)"
  1. Set an Expiration Date (choose a long duration to avoid frequent updates)
  1. Select the following scopes:
      • repo (Full control of private repositories)
      • workflow (Allows GitHub Actions to access workflows)
      • read:packages (If you use private npm packages)
  1. Click "Generate token" and copy it
  1. Go to your GitHub Repo → Settings → Secrets
  1. Add a new secret with the name GH_PAT and paste the token

2️⃣ Create an Expo Token (EXPO_TOKEN)

You can create this token directly from your Expo project settings:
  1. Open Expo.dev
  1. Go to Account Settings → Access Tokens
  1. Click "Generate New Token"
  1. Copy the token and add it as a GitHub Secret named EXPO_TOKEN
 

🛠️ Step 2: Add the GitHub Action for Expo Previews

Now that we have our tokens, we need to set up GitHub Actions:
  1. Create a new file in your repo: .github/workflows/expo-preview.yml
  1. Copy and paste the following GitHub Actions workflow:
 
 

🎯 Step 3: Open a PR and Get Your Expo Preview

Now, whenever you open or update a PR, GitHub Actions will:
✅ Start an Expo preview server
✅ Generate a QR code
✅ Automatically comment on the PR with the preview link
 
notion image
 
🥳 And that’s all folks, enjoy your new automated Expo PR process! 🥳
 
 

 

🔍 Why This Works So Well (and Why We Built It This Way)

🔹 Inspired by Vercel’s Previews

Vercel changed how we ship frontend apps. We wanted that same smooth experience for Expo & React Native projects.

🔹 Mobile-First Collaboration

No need to manually start an Expo server and send links in Slack. Now, every PR comes with a built-in preview link.

🔹 Faster Testing, Fewer Headaches

Easier QA testing and faster feedback loops from designers, PMs, and stakeholders.
 
 

 

⚡ Common Issues & Troubleshooting

GitHub Actions Failing?

Make sure:
  • You added both GH_PAT and EXPO_TOKEN to GitHub Secrets
  • Your Expo account has permissions to generate a preview
  • Try restarting Expo CLI in your local environment to see if it works.
 

QR Code Isn’t Showing in PR Comments?

Check the PR Actions Logs in GitHub to see if the Expo server started correctly.
 

❌ Still having issues?

👉 Email us or join our Discord for help!
 

 

💡 Final Thoughts

With this simple GitHub Action, you can completely automate Expo previews for your PRs, just like Vercel does for web apps.
 
No more manually sharing links. No more waiting for someone to start an Expo server. Just scan the QR code and test instantly.
 
🚀 Want More Guides Like This? Get our best tips in your inbox by joining our Newsletter!