Deploy
The generated app is a standard Vite SPA. pnpm build produces a dist/ directory that you upload to any static host.
Environment Variables
Before building, copy .env.example to .env and set both variables.
VITE_RPC_URL=https://api.devnet.solana.com
VITE_SITE_URL=https://airdrop.example.com| Variable | Purpose |
|---|---|
VITE_RPC_URL | Solana RPC endpoint used by the claim flow. On mainnet-beta, use your own RPC endpoint |
VITE_SITE_URL | Deployment URL used for Open Graph meta tags and the canonical link. Set it before the production build so social previews work |
Vite bakes build-time variables into the bundle. If you change either variable, run pnpm build again.
Build
Install
cd my-campaign
pnpm installBuild
pnpm buildThe production bundle is in dist/.
Preview locally (optional)
pnpm previewUpload to Your Host
Any static host that serves SPAs works — Vercel, Netlify, Cloudflare Pages, GitHub Pages, S3 + CloudFront, and similar.
- Follow your host’s standard Vite deployment guide
- Make sure SPA rewrites are enabled so deep links resolve to
index.html - Serve the site over HTTPS
Never deploy the .bonkit/ directory. It contains recipient wallet addresses and studio workspace state. Only the contents of dist/ should be published. This matters most when you upload manually to object storage or a custom server — double-check that nothing outside dist/ is being copied.
Hosts that build from source (Vercel, Netlify, Cloudflare Pages) publish only the build output — dist/ by default for Vite — so .bonkit/ is not served as long as you leave the output directory at its default.
HTTPS Is Required
Solana wallet extensions refuse to connect on plain HTTP. All major static hosts serve HTTPS by default — avoid custom HTTP-only setups.
GitHub Pages Sub-Path
When deploying to a sub-path such as https://username.github.io/repo-name/, set the Vite base path in vite.config.ts before building.
// vite.config.ts
export default defineConfig({
base: '/repo-name/',
// ...existing config
})Without this, the bundle assumes it is served from / and all assets will 404.
Root-domain hosts (Vercel, Netlify, Cloudflare Pages with a custom domain) do not need the base setting.
Mainnet RPC
On mainnet-beta, VITE_RPC_URL must point to your own RPC endpoint. Public mainnet RPCs rate-limit claim traffic and will cause user-facing failures.
Success Looks Like
- The deployed URL opens the campaign page over HTTPS
- Connecting a wallet succeeds with no browser warnings
- Eligibility check and claim complete end-to-end on the target network
- Social link previews show the expected title, description, and image
Common Issues
- Wallet connect modal does not open → site is served over HTTP. Switch to HTTPS.
Failed to fetch airdrop→VITE_RPC_URLis missing, pointing at the wrong network, or rate-limited. Use your own mainnet RPC.- Assets 404 on GitHub Pages →
vite.config.tsis missing thebasepath. - Social preview images broken →
VITE_SITE_URLwas not set beforepnpm build. - Routes break on refresh → SPA rewrites are not configured on the host.
Next Step
See Reference for CLI options, workspace files, and design rules.