1.0.1 • Published 4 years ago

@elateral/brandgility-embedded-api v1.0.1

Weekly downloads
21
License
UNLICENSED
Repository
github
Last release
4 years ago

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

methoddescriptionparameters
onsubscribes to eventeventName: <string>, argument: <function>
emittriggers an eventeventName: <string>, argument: <serializable, see The structured clone algorithm>

Events to listen

To subscribe on event use on method:

brandgilityEmbeddedApi.on('load', () => console.info('loaded'));
eventdescriptionarguments
loadload evententity { type: <string> , id: <string> }
savesuccess save eventid of saved item <string>
errorerror eventerror { message: <string> }

Events to trigger

To trigger an event use emit method:

brandgilityEmbeddedApi.emit('save');
eventdescriptionparameters
savesaves a current version of template-
saveAscreates a new saved customization from an existing saved customizationnew item { name: <string>, comments: <string> }
1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago