@womply/connect
TypeScript icon, indicating that this package has built-in type declarations

0.0.32 • Public • Published

Connector TypeScript Library

Integrate Womply services with your web Application using this library by following any of the methods described below.

Importing library

Install npm package

npm install @womply/connect

Import into your application

import Womply from '@womply/connect'

Configure the UI Component by passing the required parameters and callbacks.

  var womplyWidget = Womply.connect({
      key: 'my-api-key',
      onCancel: function (e: any) {
        // listen to cancel event
      },
      onSuccess: function (e: any) {
        // listen to success event
      },
      onError: function (e: any) {
        // listen to error events
      },
  })

This will create a UI Component element within the page and you can control it with the methods described below

  // Display the widget on the screen
  womplyWidget.open(
    {
      email_address: 'useremail@domain.com'
      first_name: 'user name'
      last_name: 'last'
      phone_number: '4153556754'
    }
  )
  // close UI Component
  womplyWidget.close()
  // remove all resources
  womplyWidget.destroy()  

You can also use the CDN version directly from https://unpkg.com/@womply/connect@version/dist/connect.js and just follow the steps described before.

<!-- Example using version 0.0.1 -->
<script src="https://unpkg.com/@womply/connect@0.0.26/dist/connect.js"></script>

Readme

Keywords

none

Package Sidebar

Install

npm i @womply/connect

Weekly Downloads

0

Version

0.0.32

License

MIT

Unpacked Size

70.3 kB

Total Files

27

Last publish

Collaborators

  • womply