Skip to content

Add Neon Auth Phone Number plugin documentation#4788

Closed
philip wants to merge 2 commits intomainfrom
auth/add-phone-number-docs
Closed

Add Neon Auth Phone Number plugin documentation#4788
philip wants to merge 2 commits intomainfrom
auth/add-phone-number-docs

Conversation

@philip
Copy link
Copy Markdown
Collaborator

@philip philip commented Apr 20, 2026

Summary

Adds Neon Auth docs for the upcoming Phone Number plugin (LKB-11605), mirroring the scope of the Magic Link PR (#4750).

  • New plugin page at content/docs/auth/guides/plugins/phone-number.md covering intro, prerequisites, how users link a phone to an existing account, Console + API enablement, SMS provider webhook integration (required), the two-step SDK sign-in flow, integration with AuthView, webhook events, and limitations.
  • Plugins index (content/docs/auth/guides/plugins.md): adds Phone Number row and links the nextjs-phone-login example.
  • Roadmap (content/docs/auth/roadmap.md): moves Phone Number from "On the roadmap" to Supported.
  • Manage Auth API (content/docs/auth/guides/manage-auth-api.md): adds /plugins/phone_number row.
  • Webhooks (content/docs/auth/guides/webhooks.md): adds phone_number.verified event (non-blocking), documents the SMS delivery_preference on send.otp, and updates the enabled_events list and example payload.
  • Overview (content/docs/auth/overview.md): links the nextjs-phone-login example.
  • Navigation (content/docs/navigation.yaml): adds Phone Number under Plugins (alphabetical).

Two things the page makes unmistakable:

  1. The plugin is sign-in only. A user must already exist in the project with a phone number linked to their account before they can sign in by phone.
  2. Neon Auth does not deliver SMS. A send.otp webhook that forwards the code to your SMS provider is a hard requirement.

Related PRs

Do not merge until

  1. Staging OpenAPI at /projects/{project_id}/branches/{branch_id}/auth/plugins/phone_number shows PATCH (not PUT) with a partial-update body schema. Staging currently exposes PUT with the full-object body.
  2. The Console feature-flag-gated Phone Number card is on by default.
  3. A published neon-js version includes phoneNumberClient() (feat: add redirectFrom field in the frontmatter #74) and the two bugfixes (Mention the default Postgres schema in docs #76, Add release notes #78).
  4. Replace the placeholder screenshot at public/docs/auth/neon_auth_plugins_phone_number.png with a real Console capture (the page references this path but the asset is not committed yet).

Test plan

  • Run npm run dev and visually review the new plugin page under /docs/auth/guides/plugins/phone-number.
  • Confirm the left nav shows Phone Number under Plugins in alphabetical order.
  • Click through every internal link on the new page (Webhooks guide, UI components reference, quick starts, Neon SDK reference).
  • Once the release-gate conditions above are true, run examples/nextjs-phone-login end-to-end against a flag-enabled project with a send.otp webhook wired to Twilio (or similar) and confirm the docs match the observed flow.

Follow-ups

  • SDK import path consistency. This page uses @neondatabase/neon-js/auth/react/ui to match the existing convention in email-otp.md and the Magic Link PR (Add Neon Auth Magic Link plugin documentation #4750). The examples/nextjs-phone-login app in neondatabase/neon-js imports from @neondatabase/auth/react/ui. These should be reconciled before GA — either update the example to use the documented path, or switch the Neon Auth plugin pages over to @neondatabase/auth/react/ui for consistency with the shipping SDK.

- Add new plugin page at content/docs/auth/guides/plugins/phone-number.md
- Add Phone Number row to plugins index and roadmap (moved out of "On the roadmap")
- Add /plugins/phone_number endpoint to manage-auth-api reference
- Add phone_number.verified event and note SMS delivery_preference on send.otp in webhooks guide
- Link nextjs-phone-login example from overview and plugins pages
- Add Phone Number entry to docs navigation under Plugins

Do not merge until the backend switches /plugins/phone_number from PUT to
PATCH on staging, neon-js publishes a version with phoneNumberClient (#74)
plus bugfixes (#76, #78), and the Console feature flag rolls out.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview, Comment Apr 20, 2026 9:13pm

Request Review

…erence

The send.otp webhook event_data does not include a phone_number field; the
phone number is available via user.phone_number. Removed the non-existent
fallback from the SMS handler example and rewrote the accompanying admonition
to describe the real behavior (minimal user object on first OTPs, where
profile fields beyond phone_number are not populated).

Also dropped the "and Magic Link" comparison since the Magic Link plugin
page is not yet merged on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant