1.2.0 • Published 2 years ago

shoplazza-app-bridge v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

shoplazza-app-bridge

Shoplazza App Bridge lets you embed your app directly inside the Shoplazza admin, as well as customize Shoplazza UI elements outside of your app.

Install

npm install shoplazza-app-bridge --save

Usage

// Embed App entry file
import { app } from 'shoplazza-app-bridge';

app.init();

Actions

ContextualSaveBar

The contextual save bar tells merchants their options once they have made changes to a form on the page. This component is also shown while creating a new object like a product or customer. Merchants can use this component to save or discard their work.

saveAction and discardAction type is the same with antd button type

import { contextualSaveBar } from 'shoplazza-app-bridge';

contextualSaveBar.show();
contextualSaveBar.hide();
contextualSaveBar.setSaveAction({
  type: 'primary',
  disabled: false,
  loading: false,
  text: 'Save',
  onClick: () => {
    // Do somethings
  }
});
contextualSaveBar.setDiscardAction({
  type: 'default',
  disabled: false,
  loading: false,
  text: 'Cancel',
  discardConfirmationModal: true,
  onClick: () => {
    // Do somethings
  }
});

BackLink

The backLink action set allows you to modify back button right in the top left side of admin header.

import { backLink } from 'shoplazza-app-bridge';

backLink.setAction({
  display: true,
  text: 'Return app',
  onClick: () => {
    // Do somethings
  }
});

Redirect

The Redirect action set allows you redirect to a relative path in shoplazza admin.

import { redirect } from 'shoplazza-app-bridge';

redirect('/products')

SessionToken

A session token is a mechanism that lets your embedded app authenticate the requests that it makes between the client side and your app's backend.

import { getSessionToken } from 'shoplazza-app-bridge';
getSessionToken('ExampleClientID');
1.2.0

2 years ago

1.1.0-beta.0

2 years ago

1.1.0

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

3 years ago

1.0.0-beta.0

3 years ago

1.0.0

3 years ago