Skip to content
Docs

Restrict access to production source maps

Protected Source Maps are available on all plans

Those with the owner, member and admin roles can manage Protected Source Maps

Protected Source Maps gates requests for browser source maps behind Vercel Authentication. When enabled, your deployment serves .map files only to users who can already access the deployment, and returns 404 Not Found to everyone else.

This lets you ship source maps to production so your team and error trackers can read meaningful stack traces, without exposing your source code to the public.

To get started, enable Protected Source Maps from your project's Deployment Protection settings, then use the Vercel Toolbar to view protected source maps in your browser.

You can manage Protected Source Maps from the dashboard or the REST API. Either way, access is limited to the users listed below.

The same users who can view your protected deployments can view their source maps:

  1. From your Vercel dashboard:

    1. Select the project you want to configure
    2. Open Settings in the sidebar and select Deployment Protection
  2. From the Protected Source Maps section:

    1. Use the toggle to enable or disable the feature
    2. Select Save

    The change applies to your existing deployments on the next request for a .map file. There is no need to redeploy.

Use the Vercel API endpoint to update an existing project with the protectedSourcemaps boolean field.

ParameterTypeDescription
protectedSourcemapsbooleanSet to true to gate .map requests behind Vercel Authentication, or false to disable.
curl -X PATCH "https://api.vercel.com/v9/projects/your_project_id_here?teamId=your_team_id_here" \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Content-Type: application/json" \
  -d '{"protectedSourcemaps": true}'

Set protectedSourcemaps to false in the body to disable the feature.

Browsers do not send your Vercel session with .map requests by default, so DevTools and other tools cannot load protected source maps until they authenticate against the deployment. The Vercel Toolbar signs the browser in for the current deployment.

To view protected source maps in your browser:

  1. Open the deployment you want to inspect
  2. Activate the Vercel Toolbar and sign in with an account that has access to the deployment
  3. Turn on Debug Mode in the Toolbar Menu
  4. Reload the page

Your browser DevTools resolves minified stack traces using the protected source maps. Access is scoped to the deployment URL it was issued for, and ends when you sign out of Vercel or close the Toolbar session.

Protected Source Maps only authorizes requests made from a browser with a valid Vercel session. Tools that fetch source maps from outside the browser, such as a CI pipeline uploading them to an error tracker, should use the protection bypass for automation header.

ConsiderationDescription
Plan availabilityAvailable on all plans.
Default behaviorEnabled by default for new projects. Existing projects must opt in by turning the setting on. If your build doesn't generate source maps in production, nothing is exposed today.
File scopeApplies to browser source map files (.map) served from your deployment. Inline source maps embedded in JavaScript, server-side source maps used by Vercel Functions, and source maps uploaded to third-party error trackers are unaffected.
Response when blockedUnauthorized requests receive 404 Not Found, not 401 or 403. This avoids confirming the file exists at the requested path.
CompatibilityWorks alongside Vercel Authentication, Password Protection, and Trusted IPs.
Session scopeAuthentication is tied to the deployment URL. Sessions do not carry over between URLs, even when those URLs point to the same deployment.
DisablingSetting protectedSourcemaps to false makes the deployment's source maps publicly accessible again on the next request.

When a browser requests a .map file from your deployment, Vercel checks the project's protectedSourcemaps setting before serving the response:

  • If protectedSourcemaps is true, Vercel checks the request against deployment protection and serves the source map to authorized users. Everyone else receives a 404 Not Found response, which avoids confirming whether the file exists at the requested path.
  • If protectedSourcemaps is false, the deployment serves source maps to anyone who requests them. This preserves the behavior of projects that intentionally publish source maps for public error tracking.

This protection applies to browser source maps generated during a build, such as *.js.map and *.css.map. It does not change how source maps are generated, uploaded to error trackers, or consumed in non-browser contexts.

Last updated May 14, 2026

Was this helpful?

supported.