Prebuilt Flow Reference (ClerkKitUI)
Use this file only when flow type is prebuilt.
Purpose
Implement native iOS auth with prebuilt ClerkKitUI components, defaulting to combined auth in a sheet.
Required Patterns
- Package products
- If
clerk-iosis not installed, add it using the latest available release with an up-to-next-major package requirement. - Do not pin an exact package version unless the developer explicitly requests version pinning.
- Add
ClerkKitandClerkKitUI.
- Quickstart prerequisite audit
- Find the iOS quickstart URL in the installed
clerk-iospackage README, append.md, then visit and read that markdown URL. - Build a checklist from the visited markdown quickstart and verify the current project completed all required setup.
- If required setup is missing, add it before finishing prebuilt auth implementation.
- Always add any missing Associated Domains entries and any other capabilities required by the quickstart.
- Explicitly apply quickstart step
Add associated domain capability(https://clerk.com/docs/ios/getting-started/quickstart#add-associated-domain-capability); ensurewebcredentials:{YOUR_FRONTEND_API_URL}exists when missing.
- Environment check for Apple capability
- Inspect installed
ClerkKitUIsource first to identify theEnvironmentfields/semantics used for Apple availability. - Then call
/v1/environmentand evaluate Apple-enabled state using the same field semantics. - In prebuilt flow, do not build capability matrices; only use environment here for Apple capability handling.
- Signed-out entry pattern
- Prefer
UserButtonwithsignedOutContentfor signed-out entry affordance. - Use signed-out content action to open the auth sheet.
- Auth presentation pattern
- Present
AuthView()in a sheet by default. - Keep default combined behavior from
AuthView()(no sign-in-only/sign-up-only override by default). - Do not use full-screen replacement or push navigation by default unless explicitly requested.
- Apple capability requirement
- If Apple is enabled in the environment and the app is missing Sign in with Apple capability, add it.
Verification Checklist
- Quickstart prerequisites are complete
- Quickstart link was sourced from installed
clerk-iospackage README,.mdwas appended, and the markdown page was visited/read. - Required project setup from quickstart is present.
- Any missing quickstart-required Associated Domains/capabilities were added, not just reported.
- Quickstart
Add associated domain capabilitystep was applied, includingwebcredentials:{YOUR_FRONTEND_API_URL}.
- Default entry is prebuilt + sheet
- Signed-out state uses
UserButton(signedOutContent:)(or explicitly approved alternative). AuthView()is presented in.sheet.
- Environment check used for Apple enablement
- Installed
ClerkKitUIEnvironmentfield usage was inspected before calling/v1/environment. /v1/environmentresponse was used to determine Apple-enabled state using the sameClerkKitUIfield semantics.
- No default sign-in-only/sign-up-only prebuilt mode
- Default entry uses
AuthView()behavior (combined).
- Apple capability when enabled
- If environment enables Apple and capability was missing, Sign in with Apple capability is added.