npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@agiodigital/agio-workflow-sdk

v1.1.6

Published

[![Latest version](https://img.shields.io/npm/v/@agiodigital/agio-workflow-sdk.svg)](https://www.npmjs.com/package/@agiodigital/agio-workflow-sdk) [![Latest Beta Version](https://img.shields.io/npm/v/@agiodigital/agio-workflow-sdk/beta.svg)](https://www.n

Downloads

74

Readme

Alright, I understand your requirements now. Let's revise the provided documentation.


@agiodigital/agio-workflow-sdk

Latest version Latest Beta Version License

Description

@agiodigital/agio-workflow-sdk is a JavaScript SDK designed for the seamless integration of Agio workflows into your application using an iframe. The SDK also provides a Management SDK for server-side interactions, ensuring that sensitive information like apiToken remains secured.

Installation

Use npm or yarn to install the package:

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

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

Usage

Server-side: AgioWorkflowManagementSdk

⛔ 🚫 Always fetch the SDK initialization token securely from the backend. NEVER expose your apiToken on the client-side.

The token is valid for 10 minutes and a new token can be fetched at any time.

Using the AgioWorkflowManagementSdk, you can securely manage sensitive tasks, such as fetching the SDK initialization token:

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

// Initialize with configuration
const sdkManagement = new AgioWorkflowManagementSdk({
  apiToken: "YOUR_SECURE_API_TOKEN", // required
  externalUserId: "user-123", // required
  externalUserEmail: "[email protected]",
  externalUserName: "John Doe"
});

// Fetch the SDK initialization token
const token = await sdkManagement.getToken();

Fetching SDK Initialization Token with CURL:

Alternatively, you can fetch the SDK initialization token directly using a CURL command:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "exampleUserId",
    "externalUserEmail": "[email protected]",
    "externalUserName": "Example Name",
    "apiToken": "YOUR_SECURE_API_TOKEN"
  }' \
  https://api.agiodigital.com/auth/workflow-sdk/init-token 

Replace placeholders with your actual data.

Client-side: AgioWorkflowSdk

After fetching the SDK initialization token securely from the backend, you can then utilize it on the client side:

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

// Initialize with configuration
const sdk = new AgioWorkflowSdk({
  token: "YOUR_SDK_INIT_TOKEN",  // obtained securely from your server
  workflowId: "company-setup", // required
  environment: "development" // optional (default: "production")
});

// Mount the widget
sdk.mountWidget({
  container: "#workflow-container", // query selector or DOM element
  on: {
    stepChange: (step) => {
      console.log("Step Changed:", step);
    },
    workflowComplete: () => {
      console.log("Workflow Completed");
    }
  }
});

// Optionally, unmount the widget
sdk.unmountWidget();

License

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