- R1
Create a Replit Account
Go to replit.com → Sign up → Continue with GitHub (recommended, same reasoning as the Vercel step — it links the accounts for you). Free accounts can create and publish Static Deployments with no time limit.
- R2
Import Your GitHub Repository
From the Replit home screen, click Create App → Import from GitHub, and select the repository you exported from AI Studio in Part 3. Replit clones it into a new workspace ("Repl") and detects it's a Vite project automatically.
- R3
Add Your Gemini API Key as a Secret
Most criticalOpen the Secrets tool in the left tool dock (padlock icon). Add a key named
GEMINI_API_KEYwith your key from AI Studio's API Keys page as the value. Because a static build exposes any variable prefixed for the client bundle, also addVITE_API_KEYwith the same value if your code reads it that way — check yoursrcfolder for the exact variable name your app uses.Restrict this key. A key baked into a static, client-side build can be read by anyone who inspects your app's network requests. In Google AI Studio's API Keys page, restrict the key to the Generative Language API only, and keep an eye on usage. This is different from the Vercel/Cloud Run path, where the key stays server-side. - R4
Configure the Static Deployment
Click Deploy at the top right, choose Static, and set:
Build command: npm run build Public directory: distVite's default output folder is
dist— confirm this matchesvite.config.tsin your repo before deploying. Static Deployments only serve files; they can't run a backend, which is fine here since your app calls the Gemini API directly from the browser. - R5
Publish & Go Live
Final clickClick Deploy. Replit builds your app and serves it over HTTPS at
your-app-name.replit.app— installable as a PWA exactly like a Vercel URL, once Part 3'smanifest.jsonand script tag are in place. Continue to Part 5 — Install on Android using this URL instead of your Vercel one.Free tier reminder: Static Deployments are free hosting on any Replit plan, including data transfer up to your plan's allocation (100 GiB/month on Core; a smaller allowance on the free tier) before per-GB charges apply. See the comparison table on the Best Practices page.
Other static hosts that work the same way
Any host that can build a Vite project from a GitHub repo and serve static files over HTTPS will work for this pipeline — the manifest and script-tag setup from Part 3 doesn't change. Two more worth knowing:
Netlify
Similar to VercelSign up with "Continue with GitHub", Add new site → Import an existing project, pick your repo. Build command npm run build, publish directory dist. Add your key under Site configuration → Environment variables. Free tier allows commercial use, unlike Vercel Hobby — around 100 GB bandwidth and 300 build minutes a month.
Cloudflare Pages
Best free bandwidthSign up at pages.cloudflare.com, Connect to Git, select your repo, same build settings as above. Environment variables live under Settings → Environment variables. Cloudflare's free tier has no bandwidth cap, which makes it a strong pick if you expect real traffic.