Publish & Export Your App
Learn how to publish your Refine app with a shareable link, or export the full source code to host anywhere.
Your app is ready. Now share it with the world.
Publishing vs Exporting
| Option | What you get | Available on |
|---|---|---|
| Publish | Shareable link to your live app | All plans |
| Export | Full source code to self-host | Pro only |
Most users start with Publish. Export when you need full control over hosting and customization.
Publish Your App
Get a live URL you can share with anyone.
How to publish
- Click Publish in the Console
- Wait for build to complete (~1-2 minutes)
- Copy your shareable link
What you get
- A live URL you can share
- Automatic HTTPS
- Fast loading via CDN
Tip
Publish early and often. Share with stakeholders to get feedback as you build.
Export Your Code (Pro)
Download the complete source code to host anywhere.
Code export requires a Pro subscription.
How to export
- Click Export in the Console
- Select Download
- Save the zip file
- Extract and open in your code editor
What's included
your-project/
├── src/
│ ├── App.tsx
│ ├── pages/
│ ├── components/
│ └── providers/
├── package.json
├── tsconfig.json
├── vite.config.ts
└── README.mdThis is a standard React/TypeScript project using:
- Refine framework
- Vite for bundling
- TypeScript for type safety
Running locally
# Navigate to the project
cd your-project
# Install dependencies
pnpm install
# Start development server
pnpm devYour app runs at http://localhost:5173.
Tip
Don't have pnpm? Install it with npm install -g pnpm.
Setting up environment variables
Secrets from the Console are NOT included in the download.
Create a .env file in your project root:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_anon_key
VITE_API_KEY=your_api_keyThe generated code references these via import.meta.env.VITE_*.
Hosting Your Exported Code
Once you've exported, you can host anywhere that supports React apps.
Vercel
npm install -g vercel
vercelAWS Amplify
npm install -g @aws-amplify/cli
amplify init
amplify publishDocker
Create a Dockerfile:
FROM node:18-alpine AS build
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80Build and run:
docker build -t my-app .
docker run -p 80:80 my-appStatic hosting (S3, GitHub Pages, etc.)
Build the project:
pnpm buildUpload the dist/ folder to your static host.
Self-Hosting Checklist
Before going live with your exported app:
- Environment variables are set in your hosting platform
- API keys have appropriate permissions (not admin keys)
- CORS is configured on your backend (if using REST API)
- Supabase RLS policies are enabled (if using Supabase)
- Custom domain is configured (optional)
Troubleshooting
Exported app won't run locally
Check these
- Node version — Requires Node 18+
- Missing
.envfile — Create one with your secrets - Dependency issues — Try
rm -rf node_modules && pnpm install
App works locally but not when hosted
Check these
- Environment variables are set correctly (with
VITE_prefix) - API URLs are accessible from production (not localhost)
- CORS allows your production domain
"Failed to fetch" errors
Usually means
- Backend is not reachable from the hosted frontend
- CORS is blocking requests
- API key is missing or invalid
Fix: Check browser DevTools Network tab to see the actual error.
Updating Your App
If using Publish
Changes sync automatically when you publish again.
If using Export
- Make changes in the Console
- Export again
- Merge with your existing codebase if you made local changes
Tip
If you've made manual code changes, download the new version and merge carefully to avoid overwriting your customizations.
Version Control (Exported Projects)
For team projects, put your exported code in Git:
cd your-project
git init
git add .
git commit -m "Initial export from Refine"
git remote add origin your-repo-url
git push -u origin mainFrom here, you can:
- Track changes over time
- Collaborate with teammates
- Set up CI/CD pipelines
- Continue development in your preferred IDE
Next Steps
- Using the Console — Continue building
- Prompting Guide — Improve your prompts
- Troubleshooting — Common issues