Components

Each component is a piece of Payroo's payroll product that runs inside your page. Your server mints a session that names the components the page may mount and the scopes they need; the page mounts them natively from @payroo-group/embedded-react or inside the Payroo frame shell with <PayrooFrame component="…" />. Both shells run the same component on the same session and emit the same events.

Component Who uses it Session Component id React export
Company setup the employer's admin employer, company:read, company:write company-setup CompanySetupChecklist, BankAccountForm, AtoConnection, SuperFund
Employees the employer's admin employer, employees:read, employees:write employees Employees (or EmployeeList, EmployeeForm, EmployeeRecord)
Employee self-onboarding the employee, from an invitation employee (invitation), self:onboarding employee-self-onboarding SelfOnboarding
Run payroll the employer's admin employer, payruns:read/write/lodge, documents:read run-payroll RunPayroll, PayrunReview
Pay run history the employer's admin employer, payruns:read, documents:read payrun-history PayrunHistory
Calendar the employer's admin employer, calendar:read calendar Calendar
Employee payslips the employee employee, self:payslips self-payslips SelfPayslips

Every page below shows the component as the showcase renders it on synthetic data, links to it running there, then the session it needs, how to mount it in each shell, its props, the events it emits in the page and the errors it can show.

Mount any component

import { createServerSessionAdapter } from '@payroo-group/embedded-core';
import { PayrooProvider, Employees, PayrooFrame } from '@payroo-group/embedded-react';

const adapter = createServerSessionAdapter({
  mode: 'staging',
  capabilities: ['v1-embedded'],
  apiBaseUrl: 'https://sandbox.payroo.com.au/api/v1/embedded',
  sessionUrl: '/payroll/session', // your route: POST, returns the session as Payroo returned it
});

<PayrooProvider adapter={adapter} onEvent={(e) => track(e.name, e.payload)}>
  <Employees /> {/* native: your DOM, your theme tokens */}
  <PayrooFrame component="employees" /> {/* frame: Payroo's origin, your theme tokens */}
</PayrooProvider>;

The session route, the provider options and the theme tokens are in Getting started and Embedding the React package; the frame shell's own props are in Embedding the frame shell.

Errors every component can show

Code Meaning Next action
session_expired the session ran out and could not be refreshed your session route is called again; check it still answers 201
component_not_in_session the session does not name this component add the component id to the session your server mints
scope_missing the session lacks a scope this component needs add the scope listed on the component's page
frame_blocked the frame (or a secure field) did not load add frame-src for Payroo's origin; register the page's origin

The full list, with the HTTP status of each, is on Errors.