-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add phone number support to ClerkUser state #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds phone number support to the ClerkUser state so apps can read and update a user’s phone number via the Clerk backend API.
Changes:
- Adds
phone_numberandphone_number_idtoClerkUserand loads them inload_user. - Introduces
ClerkUser.update_phone_numberplus a standaloneupdate_user_phone_numberhelper. - Adds a GitHub Actions workflow intended to sync a fork with upstream.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| custom_components/reflex_clerk_api/clerk_provider.py | Adds phone number fields, loading, and update APIs for Clerk users. |
| .github/workflows/sync-upstream.yml | Adds an automated upstream sync workflow (not related to phone number support). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove unrelated sync-upstream.yml workflow (should be in separate PR) - Fix primary phone number selection to use primary_phone_number_id - Refactor ClerkUser.update_phone_number to use helper (DRY principle) - Add verified parameter (default False) for security-conscious phone updates - Fix PII logging: use DEBUG level, redact sensitive identifiers - Fix docstring: remove incorrect 'unchanged' return case - Export update_user_phone_number in __init__.py Addresses Copilot code review comments on PR TimChild#19
- Add phone_number and phone_number_id properties to ClerkUser - Add update_phone_number method with verified parameter (default: False) - Add update_user_phone_number helper function for custom handlers - Load primary phone number in load_user event handler - Export update_user_phone_number in package __init__.py
Summary
This PR adds phone number support to the
ClerkUserstate class, enabling applications to access and manage user phone numbers through the Clerk API.Changes
phone_numberandphone_number_idproperties toClerkUserstateupdate_phone_numbermethod toClerkUserfor updating user phone numbersupdate_user_phone_numberhelper function for use in custom event handlersload_userevent handlerUsage Example
Notes
phone_number_idis needed for updating/deleting phone numbers via Clerk API