@agiodigital/agio-workflow-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@agiodigital/agio-workflow-sdk

Latest version Latest Beta Version License

Description

@agiodigital/agio-workflow-sdk is a JavaScript SDK for integrating Agio workflows into your application via an iframe.

Installation

To install the package, you can use npm or yarn:

# Using npm
npm install @agiodigital/agio-workflow-sdk

# Using yarn
yarn add @agiodigital/agio-workflow-sdk

Usage

First, import the AgioWorkflowSdk class and create a new instance with the required configuration options:

// Import the module
import { AgioWorkflowSdk } from '@agiodigital/agio-workflow-sdk';

// Initialize with configuration
const sdk = new AgioWorkflowSdk({
  workflowId: "workflow-123",
  externalUserId: "user-123",
  apiToken: "your-api-token",
  environment: "production"
});

Mounting the Widget

To embed the Agio workflow in your application, call the mountWidget function with an options object:

sdk.mountWidget({
  container: "#workflow-container",
  on: {
    stepChange: (step) => {
      console.log("Step Changed:", step);
    },
    workflowComplete: () => {
      console.log("Workflow Completed");
    }
  }
});

Unmounting the Widget

To remove the Agio workflow iframe from your application, call the unmountWidget function:

sdk.unmountWidget();

License

This project is licensed under the MIT License. See the LICENSE file for details.

Readme

Keywords

none

Package Sidebar

Install

npm i @agiodigital/agio-workflow-sdk

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

162 kB

Total Files

45

Last publish

Collaborators

  • agiodigital-owner