Redirect

The Redirect action set allows you to modify the top-level browser URL. Use the Redirect action set to navigate within your app, or to redirect merchants elsewhere within the Shopify admin or on the web.

Setup

Create an app and import the Redirect module from @shopify/app-bridge/actions. Note that we'll be referring to this sample application throughout the examples below.

Redirect to a relative path in the app

Redirect to a local app path. The path must be prefixed with a slash and is treated as relative to the app origin:

Redirect to an absolute URL outside of the app and outside of Shopify admin.

Open in a new window

Add the newContext option (equivalent to <a target="_blank">):

Redirect to a relative path in Shopify admin

Redirect to the customers section in Shopify admin. The path must be prefixed with a slash.

Redirect to a named section in Shopify admin

Redirect to the Products section in the Shopify admin:

Redirect to a specific resource in Shopify admin.

Redirect to the collection with the ID 123 in the Shopify admin:

Redirect to create a product in Shopify admin.

Redirect to {shopUrl}/admin/products/new in the Shopify admin:

Redirect to a product variant in Shopify admin.

Redirect to the collection with the id '123' in Shopify admin:

Redirect to create a new product variant in Shopify admin.

Redirect to {shopUrl}/admin/products/123/variants/new in the Shopify admin:

Subscribe to actions

You can subscribe to actions dispatched through the redirect action set:

Subscribe to all redirect actions

You can subscribe to all redirect actions within your app, regardless of which action sets trigger the actions:

Current restrictions

Query Params

The use of query params is not supported. All query params are removed from the path during the redirect.