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

OptionWhat you getAvailable on
PublishShareable link to your live appAll plans
ExportFull source code to self-hostPro 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

  1. Click Publish in the Console
  2. Wait for build to complete (~1-2 minutes)
  3. 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

  1. Click Export in the Console
  2. Select Download
  3. Save the zip file
  4. 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.md

This is a standard React/TypeScript project using:

Running locally

# Navigate to the project
cd your-project

# Install dependencies
pnpm install

# Start development server
pnpm dev

Your 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_key

The 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
vercel

AWS Amplify

npm install -g @aws-amplify/cli
amplify init
amplify publish

Docker

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 80

Build and run:

docker build -t my-app .
docker run -p 80:80 my-app

Static hosting (S3, GitHub Pages, etc.)

Build the project:

pnpm build

Upload 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

  1. Node version — Requires Node 18+
  2. Missing .env file — Create one with your secrets
  3. Dependency issues — Try rm -rf node_modules && pnpm install

App works locally but not when hosted

Check these

  1. Environment variables are set correctly (with VITE_ prefix)
  2. API URLs are accessible from production (not localhost)
  3. CORS allows your production domain

"Failed to fetch" errors

Usually means

  1. Backend is not reachable from the hosted frontend
  2. CORS is blocking requests
  3. 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

  1. Make changes in the Console
  2. Export again
  3. 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 main

From here, you can:

  • Track changes over time
  • Collaborate with teammates
  • Set up CI/CD pipelines
  • Continue development in your preferred IDE

Next Steps

On this page