SimpleAuth
ReactCLI

add

Add sign-in, sign-up, or modal features (or presets) to an initialized SimpleAuth React project.

Synopsis

npx @simpleauthjs/react add <featureOrPreset> [flags]

Run init first so components/simpleauth/index.ts exists.

Features

IdDescriptionFiles writtenStylesDefault style
google-authGoogle sign-in hook and branded button plus style sheet.hooks/use-google-auth.ts, ui/google-button.tsx, styles/google-button.css (+ styles/tokens.css for token variants)minimal & modern (docs); CLI accepts moreminimal
github-authGitHub sign-in hook and branded button plus style sheet.hooks/use-github-auth.ts, ui/github-button.tsx, styles/github-button.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
sign-inEmail and password sign-in hook and form plus style sheet.hooks/use-sign-in.ts, ui/sign-in-form.tsx, styles/sign-in-form.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
sign-upRegistration hook, VerifyEmailPrompt, form, and style sheet.hooks/use-sign-up.ts, ui/verify-email-prompt.tsx, ui/sign-up-form.tsx, styles/sign-up-form.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
modalSign-in and sign-up modal components plus modal style sheet.modals/sign-in-modal.tsx, modals/sign-up-modal.tsx, styles/simpleauth-modal.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
forgot-passwordForgot password hook, page form, modal, and CSS.hooks/use-forgot-password.ts, ui/forgot-password-form.tsx, modals/forgot-password-modal.tsx, styles/forgot-password-form.css, styles/forgot-password-modal.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
reset-passwordReset password hook, form, and CSS.hooks/use-reset-password.ts, ui/reset-password-form.tsx, styles/reset-password-form.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
verify-emailVerify and resend hooks plus callback UI (requires sign-up first for VerifyEmailPrompt).hooks/use-verify-email.ts, hooks/use-send-verification-email.ts, ui/verify-email-callback.tsx, styles/verify-email-callback.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
sign-outSign-out hook and unstyled button.hooks/use-sign-out.ts, ui/sign-out-button.tsxminimal & modern (docs); CLI accepts more (style flag; no extra CSS)minimal
delete-accountDelete account hook, form, and CSS.hooks/use-delete-account.ts, ui/delete-account-form.tsx, styles/delete-account-form.css (+ tokens.css when applicable)minimal & modern (docs); CLI accepts moreminimal
sessionuseAuth, SignedIn, SignedOut, Protected, Show.hooks/use-auth.ts, ui/signed-in.tsx, ui/signed-out.tsx, ui/protected.tsx, ui/show.tsxminimal & modern (docs); CLI accepts more (style flag; no CSS)minimal

Presets

PresetExpands to (stable order)
basicgoogle-auth, github-auth, sign-in, sign-up, forgot-password, reset-password, verify-email
fullbasic features, then modal, sign-out, delete-account, session

Flags

NameTypeDefaultDescription
--cwdstringCurrent working directoryProject root.
--forcebooleanfalseOverwrite files if they already exist.
--stylestringminimalVisual variant for styled features. This site documents minimal and modern with live previews on Style variants. Run npx @simpleauthjs/react add --help for every slug the CLI accepts.

Documented --style slugs on this site:

minimal
modern
# examples
npx @simpleauthjs/react add sign-in --style modern
npx @simpleauthjs/react add modal --style minimal

Composition rules

  • Running add with the same feature and style skips existing files unless you pass --force; index.ts export lines are deduplicated when the CLI appends exports.
  • Presets always expand features in the order listed above so file outputs stay predictable.

On this page