Start URL and Scope
You'll learn how to define where your PWA launches and which pages it controls, creating clear boundaries for your app experience.
What Are Start URL and Scope?
When a user installs your PWA and taps its icon, where should they land? That's your start_url. Meanwhile, scope defines which pages are considered "inside" your PWA versus external links that should open in a regular browser.
Think of it like a building's entrance and property line. The start_url is the front door everyone uses when they arrive. The scope is the fence around your property—anything inside is part of your PWA; anything outside is a different destination.
Why This Matters
Without a start_url, browsers guess where to send users (often just /). Without a defined scope, your PWA might behave inconsistently—sometimes showing your custom UI, sometimes not.
Start URL
{
"start_url": "/dashboard?source=pwa"
}
This launches users at /dashboard with a tracking parameter. The path is relative to your manifest location. You can add query strings to track PWA-specific analytics.
Scope
{
"scope": "/app/"
}
This tells the browser that any URL starting with /app/ belongs to your PWA. Navigate to /about? That opens in a regular browser tab. Navigate to /app/profile? Stays within your PWA experience.
The scope must contain the start_url. If omitted, scope defaults to the manifest's directory.
Common Pattern
{
"start_url": "/",
"scope": "/"
}
This makes your entire domain part of the PWA—simple and common for single-domain apps.
Key Takeaway: Use start_url to control your PWA's entry point and scope to define which pages stay within your app experience, creating clear boundaries between your PWA and the broader web.