Maintenance Mode
Detect and handle maintenance mode on the storefront.
Updated
On this page
Overview
Maintenance mode temporarily takes your storefront offline while you make updates. Visitors see a maintenance page instead of the regular store.
Enabling Maintenance Mode
Toggle maintenance mode in the dashboard under Settings → General.
Detecting Maintenance Mode
import dash from "@/lib/dash"
try {
const data = await dash.getGlobalData()
} catch (error) {
if (error.status === 503) {
// Store is in maintenance mode
// Show maintenance page
}
}
Maintenance Page Example
export function MaintenancePage() {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="text-center">
<h1 className="text-3xl font-bold">We'll Be Right Back</h1>
<p className="mt-4 text-gray-400">
We're making some improvements. Check back soon!
</p>
</div>
</div>
)
}
Next Steps
- getGlobalData() — Global store settings
- Deployment — Deploying your storefront