@elateral/brandgility-embedded-api

1.0.1 • Public • Published

How to embed Brandgility's configurator into an iframe:

  • get the id of template to be configured from Brandgility application
  • To open an asset for customization, copy and paste below code into your page/component, replace :id in src attribute with your template's id:
<iframe src="<BRANDGILITY_ENDPOINT>/embedded-template-configure/{new|edit}/:id?action=DRAFT_TEMPLATE_CONFIGURATION_START&eid=:id&embedded=true" />
  • To configure an already saved template customization, copy and paste below code into your page/component, replace :id in src attribute with your saved template customization id:
<iframe src="<BRANDGILITY_ENDPOINT>/embedded-template-configure/{new|edit}/:id?action=DRAFT_TEMPLATE_CONFIGURATION_EDIT&eid=:id&embedded=true" />

API library

Brandgility embedded api library allows you to issue commands to Brandgility configurator in embedded mode

Methods

method description parameters
on subscribes to event eventName: <string>, argument: <function>
emit triggers an event eventName: <string>, argument: <serializable, see The structured clone algorithm>

Events to listen

To subscribe on event use on method:

brandgilityEmbeddedApi.on('load', () => console.info('loaded'));
event description arguments
load load event entity { type: <string> , id: <string> }
save success save event id of saved item <string>
error error event error { message: <string> }

Events to trigger

To trigger an event use emit method:

brandgilityEmbeddedApi.emit('save');
event description parameters
save saves a current version of template -
saveAs creates a new saved customization from an existing saved customization new item { name: <string>, comments: <string> }

Readme

Keywords

none

Package Sidebar

Install

npm i @elateral/brandgility-embedded-api

Weekly Downloads

32

Version

1.0.1

License

UNLICENSED

Unpacked Size

10.4 kB

Total Files

6

Last publish

Collaborators

  • artem.synytsin
  • togrulkerimov
  • tomnobleexternal
  • mikebuslenko-brandgility
  • serhiiharbo
  • oleksandrveprykqamadness
  • arina_kysilova
  • bohdanbg
  • bo_stan
  • denys_bielik_qa
  • johnbarnard_brandgility
  • ihor.bondarenko.acropolium
  • danadmsbrandgility
  • mattelliselateral
  • yuriy1988
  • elateralltd
  • davesykes
  • eamonn.doherty.elateral
  • matt-best-elateral
  • cheekytinker
  • viacheslav_lubenets
  • epimetheus
  • robert.atkinson.elateral