Redirect

Overview

The redirect method enables you to modify a browser URL, and open specific menus and pages within the SHOPLINE backend.

This allows apps to include direct links to areas within the SHOPLINE admin that are relevant and useful to a merchant’s workflow.

NameDescriptionParameter
replaceToChange current window urlurl
routerToPage jump based on Adminurl
ToAdminPageSpecific page jump based on AdminToAdminPage params

ToAdminPage parameter description:

NameDescriptionType
admin_sectionSpecific resource pageADMIN_SECTION
idResource idstring
createEnter resource creation pageboolean
newContextOpen a new pageboolean
Note

If both create and id are used, the resource creation page will be redirected to first.

Code example

import { Redirect } from '@shoplinedev/appbridge'
const redirect = Redirect.create(app)
// Redirect
redirect.replaceTo(redirectUri)
// Route Jump
redirect.routerTo(redirectUri)
redirect.ToAdminPage(Redirect.ADMIN_SECTION.CATEGORIES, {
create: true,
id: '1000001',
newContext: true
})
Was this article helpful to you?