Skip to main content
A lightweight JavaScript SDK for embedding the Payroll Integrations onboarding flow into your web application via an iframe.

Overview

The SDK mounts a secure iframe into a host element on your page and handles two-way communication between your app and the Payroll Integrations platform using the postMessage API.

Installation

The SDK package is available on the npm registry.

Usage

  1. Add a host element to your page:
  1. Call bootstrap with the onboardingLink obtained from the Create Employer Invite Session endpoint:

Configuration

A configuration object must be provided to the bootstrap function. It has the following properties: Link retrieved from the Create Employer Invite Session endpoint Type: string

selector

CSS selector for the element to mount the iframe into Type: string Default: #pi-host

callbacks.success

Called when onboarding completes successfully Type: (value: string) => unknown

callbacks.error

Called when an error occurs Type: (value: string) => unknown

callbacks.message

Called for outbound debug messages sent from the iframe Type: (value: string) => unknown

frameHost

Intended for development only. Overrides the iframe host URL. Type: string Default: https://secure.payrollintegrationsapp.com