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.
Related API
Name | Description | Parameter |
---|---|---|
replaceTo | Change current window url | url |
routerTo | Page jump based on Admin | url |
ToAdminPage | Specific page jump based on Admin | ToAdminPage params |
ToAdminPage parameter description:
Name | Description | Type |
---|---|---|
admin_section | Specific resource page | ADMIN_SECTION |
id | Resource id | string |
create | Enter resource creation page | boolean |
newContext | Open a new page | boolean |
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?