A demo for Authgear Flow API made with React + TypeScript + Vite.
npm install
npm run dev
To add new step in flows, update src/FlowForm.tsx
:
- Add new enum value to
FlowStep
enum - Add new state node to
FlowStepTypes
type (current state, possible states, state input, state output) - Implement and add new executor to
flows
map with new step - Implement and add new components
- Add new switch-case branch to
FlowStepForm
component
Everything is typed and checked in TypeScript transpiling. The type FlowStepTypes
defines possible transitions from each step (FlowStep
enum) with typed input and output. The input will be passed to FlowStepForm
component as state
; the output will be the input type of executeFlow
.