@aikon/webpopup
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

Aikon Web Popup

Popup Web User Experience

Overview

This library provides a wrapper for an iFrame that executes code on a remote server (at hostUrl) It expects the embedded code to be downloadable from WIDGET_DOWNLOAD_PATH and implement the interface WebWidgetCore This code is expected to use the Zoid component.

Start a flow by triggering the user popup:

import { WebPopupInitializer } from "@aikon/webpopup"

  // init the popup
  const options = {
    appId: 'my-service-app-id',
    hostUrl: 'https://myservice.com',
  }
  const popupInit = WebPopupInitializer()
  const webPopup = await popupInit.init(options)


  // trigger the popup to appear and run an action on host service
  webPopup.launch('myAction', {appId: 123, actionParam1: '123'})
  .then((result) => {console.log('myAction result', result)})
  .catch((error) => {console.log('error', error)})

This will launch a pop-up. When the user finishes the flow, the onError or onSuccess callback will be called.

Important

  • This library must be used within browser or a web wrapper component that has a window object
  • The popup flow should be triggered by the user clicking a button, link, or some other item that causes an Event. This will help get around pop-up blockers

Installation

npm install @aikon/webpopup

Readme

Keywords

none

Package Sidebar

Install

npm i @aikon/webpopup

Weekly Downloads

1

Version

0.0.11

License

MIT

Unpacked Size

56.9 kB

Total Files

41

Last publish

Collaborators

  • apimarket