ExtantApe

payload plugin wizards

by ExtantApe
Forms
v3
^3.80.0
MIT

Overview

Summary generated from the README

Adds a guided-steps collection and a client Wizard component that shows one question per screen, where a Yes is required to continue. Steps hold text, optional video with captions, and stop messages, and are edited in the admin. Flows are registered in code, and answersFor checks submitted answers on the server and returns a record to keep. Requires Payload 3.80 or later and an edit access rule.

Features

  • Step collection with gate, info and choice kinds, plus question, text, video, captions and stop message
  • Wizard React component with focus handling, step counter, Back and captioned video
  • Server-side answersFor refuses No answers, blank text, missing steps and changed wording
  • Content hash per step and a record of language, hashes and answers to store with your action
  • Flows registered in code or by other plugins through config.custom.wizardFlows
  • Optional scope setting that limits steps to one site on multi-site databases

Use cases

  • Require users to confirm safety instructions before activating a product
  • Build onboarding checklists with video guidance and recorded confirmations
  • Run several sites from one database with each site editing only its own steps

From the author

Wizards for Payload: gated step-by-step flows, one question per screen with Yes needed to go on, a video and text per step edited in the admin, and the answers checked on the server and recorded.

Installation

npm i @extantape/payload-plugin-wizards

0

Stars

0

Forks

1

Open Issues

Today

Last Updated

369

Weekly Downloads

v0.1.1

npm Version

58.9 KB

Unpacked Size

0

Dependencies

GitHub stars

00 since Nov 8

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260
Nov 28, 20260
Nov 27, 20260
Nov 26, 20260
Nov 25, 20260
Nov 24, 20260
Nov 23, 20260
Nov 22, 20260
Nov 21, 20260
Nov 20, 20260
Nov 19, 20260
Nov 18, 20260
Nov 17, 20260
Nov 16, 20260
Nov 15, 20260
Nov 14, 20260
Nov 13, 20260
Nov 12, 20260
Nov 11, 20260
Nov 10, 20260
Nov 9, 20260
Nov 8, 20260
npm weekly downloads

358+358 since Nov 14

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 2026358
Dec 4, 2026352
Dec 3, 2026327
Dec 2, 2026293
Dec 1, 2026255
Nov 30, 2026217
Nov 29, 202622
Nov 28, 202619
Nov 27, 202624
Nov 26, 202621
Nov 25, 202624
Nov 24, 202633
Nov 23, 202652
Nov 22, 2026226
Nov 21, 2026223
Nov 20, 2026216
Nov 19, 2026216
Nov 18, 2026210
Nov 17, 2026198
Nov 16, 2026178
Nov 15, 20260
Nov 14, 20260

Each point is npm's rolling 7-day download count.

Health Score

66/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1456392457-root.svg)](https://payloaddirectory.dev/plugins/1456392457-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1456392457-root"><img src="https://payloaddirectory.dev/badge/1456392457-root.svg" alt="Payload Directory"></a>
Updated Dec 5, 2026Created Nov 13, 2026Published Nov 27, 2026

README

payload-plugin-wizards

Wizards for Payload: gated step-by-step flows, one question per screen with Yes needed to go on, a video and text per step edited in the admin, and the answers checked on the server and recorded.

Status: early (0.x). 475 tests pass: 29 server tests on Payload 3.92 with an in-memory MongoDB, 13 on SQLite for blank text, 402 for the scope option, mostly run on MongoDB and SQLite, and 31 component tests in jsdom. It hasn't been tested on a real site, and nothing has run in a real browser.

What it does

  • Steps in the admin (guided-steps): each has a flow, a key, a group, an order and a kind:

    • gate: Yes needed to go on;
    • info: Next;
    • choice: options, any of which can stop the flow.

    Each step also has its question, a text version, an optional video with required captions, a stop message, and active or not.

    • Every step needs a question, and every gate and choice a stop message, which says what to do when the answer is No. Text that is only spaces doesn't count. A choice's options each need their own value and a label.
    • A video has to be a video file, and its captions a WebVTT file.
    • Each step's content hash covers what a person confirms (question, text, kind, options, stop message, video and captions) in the language they read it. It's worked out each time a step is read, so it can't go stale.
    • Editors (access.edit, required) change steps. The public reads active ones only.
  • Flows are registered in code: a list of slots, either your own code steps (finding a kit with the camera, choosing an animal) or a group of content steps. Other plugins register flows at config.custom.wizardFlows with no import, and a flow registered twice, or one that uses a group of steps twice, stops the site at start-up.

  • flowSteps(payload, { flow, locale, req }) gives the flow's slots, with active steps in order, for the page. A step whose question, stop message or an option label is blank in that language is left out and named in blank. With localization.fallback: false, an untranslated step is blank. Show an error instead of the flow when blank or empty has anything in it.

  • <Wizard> (./client) shows one step per screen:

    • focus on the question, "Step N of M", and Back;
    • No shows the stop message and stays, and withdraws an earlier Yes on that step;
    • video with captions, never autoplaying, and the text version always shown;
    • your code steps rendered with next and back;
    • a step with a blank question, stop message or option label shows an alert in place of the step, with no way to answer it;
    • state in memory only.
  • The answers are checked on the server, not trusted. Call answersFor(payload, { flow, answers, req }) before acting. It refuses:

    • a No, or a stopping choice;
    • a step whose question, stop message or an option label is blank in the language asked for (blankStep), so nobody is recorded agreeing to text they weren't shown;
    • a missing, extra or repeated step;
    • a group of steps with no active step, so a safety group that was never seeded, is misspelled or was switched off never waves the flow through;
    • any step whose wording changed since the screen loaded;
    • a flow it doesn't know.

    Pass the locale the person read. It returns the record to keep with your action: the language, each step's hash and question as the person read them, the answers, and the time. The hash identifies the full wording; the plugin keeps no copy of older wording, so keep versions on guided-steps if you need to show a past version in full. A client can't skip a gate by posting straight to your action.

Scope: one site's steps for one site

For a platform that runs several sites from one database. Unset, nothing changes: every caller sees every step, as in 0.1.0.

wizardsPlugin({
  flows,
  access: { edit },
  scope: {
    where: ({ req }) => {
      if (!req.user?.site) throw new Error('No site') // refuses plainly
      return { site: { equals: req.user.site } }
    },
    indexWith: ['site'],
  },
})
  • where runs on every call with the request. If it throws, the call is refused. A scope may use only equals and in. equals takes one non-empty string or number. in takes a non-empty list of them. The plugin refuses everything else at every depth, so a filter can't match everything by accident or mean one thing in memory and another in a database: any other operator (not_equals, not_in, exists, like, contains and the comparisons), an empty string, null or undefined, a list with an empty or null entry, an empty and or or, an empty {}, and anything that isn't a plain object. and and or can nest. Build or lists so that a user with no sites throws instead of producing { or: [] }. If a user's site can be an object (a populated relationship), return its id. A host that wants every site leaves scope unset.
  • Reads: the scope is ANDed with what the access rules already allow, so the REST API, GraphQL, count and the Local API with overrideAccess: false only see the caller's steps. flowSteps and answersFor take req and apply the scope themselves. With a scope set and no req they refuse (answersFor answers noScope) and never fall back to all sites.
  • Writes: update and delete access are limited to the caller's steps. A create or update is checked at the database adapter, on the step exactly as it will be stored, after every field hook and every collection hook, including any your own plugins add. One that would leave the scope, including a move to another site, is refused with a 403 and nothing is written. That works the same with or without database transactions. The stored value of every field in the scope has to be a string or a number, so a missing, null, list or object value is refused. An update or a delete also reads the steps it would touch and refuses unless every one of them is inside the scope, so a call can't take another site's step into its own site or delete it. That covers overrideAccess: true calls and direct db.updateOne, db.deleteOne and db.deleteMany calls, and a where that matches steps on two sites is refused whole. A call with no req is refused. While a scope is set, updateMany and upsert on the adapter for the steps are refused, and so is updateOne with upsert set. A delete through the collection is also checked in beforeDelete. The stored-step check reads first and writes after, and the write is handed the scope in its where, so a step that moves to another site in between is not touched (the call then does nothing, or touches only the steps still in scope). The read uses the call's locale. A seeding script has to pass a req the hook accepts.
  • Plugin order: the check wraps db, so set db in the config before this plugin and list wizardsPlugin last among the plugins that touch db. A plugin listed before it that wraps create, updateOne or deleteOne (or deleteMany) runs after the check, so its changes to those calls are not checked. At start-up the plugin looks at the adapter the site actually runs. If find, create, updateOne, deleteOne, deleteMany, updateMany or upsert is not the one this plugin wrapped (a later plugin put the original db back, or wrapped it again), the site refuses to start and the error says so.
  • indexWith adds your field names to the unique index on flow + key. Sites that share step keys need it, because without it the index is flow + key alone, so a second site can't reuse a key. Even then a duplicate key is answered with a 400 "must be unique" without indexWith, including for a key that only another site uses, so the answer tells a caller that the key exists elsewhere. Set indexWith if that matters to you. You add the field yourself, in a plugin or config that runs after Wizards ({ name: 'site', type: 'text', required: true, index: true }, for example); naming a field that doesn't exist stops the site at start-up. If scope is set without indexWith, a warning is logged at start-up.
  • Videos and captions: the file-type check when a step is saved, and the files flowSteps returns, are looked up as the caller (overrideAccess: false), so a site can't attach or show another site's files. Give your media collection its own site-based read access. A file the caller can't read shows as no video.
  • Per-site checks: the group-with-no-active-step refusal runs inside the caller's scope. A site that never seeded its safety group is refused even when another site has one. The start-up checks (a flow registered twice, a group used twice) stay across the whole config.
  • Versions and drafts: with a scope set, the steps collection can't have versions or drafts (autosave included). They write through adapter calls the scope check doesn't cover, and their reads aren't scoped. If a later plugin or your config turns them on, the site refuses to start. With no scope, nothing changes.
  • Limits: Tested on MongoDB (replica set and standalone) and SQLite (with and without transactions).

On its own, and with others

On its own: Wizards needs only Payload, an access.edit rule, and an upload collection if your steps have videos (media, or false for none). Your site registers its flows in flows and renders its own code steps.

Needs: Payload ^3.80.0 as a peer dependency, with React ^19.0.0 optional. No other EXTANT APE plugin is required.

Works with:

  • Sample Kits: with adapters.wizards, Sample Kits registers its kit-activation flow at config.custom.wizardFlows and checks the answers with answersFor.
  • Scan: a code step can show Scan's <CameraScanButton>, for example to find a kit. Neither plugin imports the other.

Color Theory: no direct link. The wizard client brings no colors of its own and takes your site's CSS, so a site styled with Color Theory's --palette-* tokens styles it too.

Family: Wizards sits in the Fulfillment family, with Kitting, Restock, Sample Kits, Shipping, Scan, Labels, Custody and Sequences, though the families are a working draft and Fulfillment is due to be split into different groups.

Install

npm install @extantape/payload-plugin-wizards
import { wizardsPlugin } from '@extantape/payload-plugin-wizards'

wizardsPlugin({
  flows: { 'kit-activation': { slots: [{ code: 'find-kit' }, { steps: 'safety' }, { code: 'sampled' }] } },
  access: { edit: ({ req }) => req.user?.role === 'editor' }, // required
  media: 'media', // your upload collection for videos and captions, or false
})

// In your action, before doing anything:
const check = await answersFor(payload, { flow: 'kit-activation', answers, locale })
if (!check.ok) return refuse(check.problem)
await markSampled(kit, { confirmed: check.record })

Commands

npm test
npm run typecheck
npm run build

License

MIT. See LICENSE.

Similar plugins