Trigger Redirects In PWA Kit

To redirect whole pages or assets, use the Redirect functionality provided by Runtime Admin or the Managed Runtime API. See Redirects.

The Progressive Web App (PWA) Kit uses React Router redirects. However, the React Router Redirect component does not let you set a status code.

In PWA Kit 3.9, we added a RedirectWithStatus component that builds on top of the React Router Redirect component and allows you to create redirects with a status code.

Example 

The example below shows how you would add a redirect with an HTTP 301 status from an example page to the login page in your PWA Kit project.

1import React from 'react'
2import RedirectWithStatus from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/redirect-with-status'
3
4const ExamplePage = () => {
5    return (
6        <RedirectWithStatus status={301} to='/login' />
7    )
8}

Node 20 Deprecation

Node 20 has an end-of-life date of April 30, 2026. We strongly recommend that you update your production projects to Node 22 or Node 24 by upgrading to the latest minor version of PWA Kit 3.x. See full details on Node support dates and upgrade steps in Upgrade Node Version.