Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c19e6f6
Update import paths in ClerkSessionSynchronizer to use relative paths…
PJ-Snap Oct 8, 2025
3227487
Merge pull request #1 from snap-analytics/fix-EventLoopContext-import
PJ-Snap Oct 8, 2025
784b765
Refactor event handling in ClerkSessionSynchronizer to use ReflexEven…
PJ-Snap Oct 8, 2025
86d3098
Merge pull request #2 from snap-analytics/fix-EventLoopContext-import
PJ-Snap Oct 8, 2025
704a419
Add organization management components: CreateOrganization, Organizat…
PJ-Snap Oct 17, 2025
78e66c7
Merge pull request #3 from snap-analytics/organization-components
PJ-Snap Oct 17, 2025
c90e2e3
Update __init__.py to include organization management components in t…
PJ-Snap Oct 17, 2025
99c5a3d
update license field for PEP621
PJ-Snap Nov 18, 2025
e1ab883
Refactor OrganizationSwitcher and OrganizationList components to upda…
PJ-Snap Dec 12, 2025
79e9b52
Update clerk-backend-api dependency to version 4.0.0 in pyproject.toml
PJ-Snap Dec 12, 2025
a65e676
Enhance organization components with updated prop types and additiona…
PJ-Snap Dec 12, 2025
1405202
Update authlib dependency in pyproject.toml to remove upper version c…
PJ-Snap Dec 12, 2025
d6329de
fix: resolve auth timeout and ExpiredTokenError in multi-worker envir…
uzair-snap Jan 9, 2026
c554474
Enhance JWT validation and ClerkSessionSynchronizer functionality
uzair-snap Jan 12, 2026
40d6fbc
Update pytest configuration and enhance JWT validation
uzair-snap Jan 12, 2026
502d33b
Merge pull request #4 from snap-analytics/fix/auth-session-sync-relia…
uzair-snap Jan 12, 2026
1943189
Merge remote-tracking branch 'upstream/main'
PJ-Snap Apr 7, 2026
5bb9e65
chore: Update clerk-backend-api dependency to version 5.0.0
PJ-Snap Apr 7, 2026
91e9412
feat: add Clerk Show and PricingTable wrappers
PJ-Snap Apr 7, 2026
97ff052
fix: switch Clerk component library to @clerk/react
PJ-Snap Apr 7, 2026
1ffab93
fix: import useAuth from @clerk/react
PJ-Snap Apr 7, 2026
335bb94
feat: add ClerkProvider ui pin support
PJ-Snap Apr 7, 2026
f3c35e3
refactor: remove deprecated control wrappers
PJ-Snap Apr 7, 2026
dc0a994
Fix Reflex background lock usage for Clerk auth wait and user load
PJ-Snap Apr 29, 2026
7210930
Fix wait_for_auth_check deadline with StateProxy (use ClerkState clas…
PJ-Snap Apr 29, 2026
41e2e26
Handle expired JWT auth: skip sending stale tokens; mark auth checked…
PJ-Snap Apr 29, 2026
2f685a3
Pin Clerk frontend version set
uzair-nafian May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ def index() -> rx.Component:
return clerk.clerk_provider(
rx.container(
clerk.clerk_loaded(
clerk.signed_in(
clerk.show(
clerk.sign_on(
rx.button("Sign out"),
),
when="signed-in",
),
clerk.signed_out(
clerk.show(
rx.button("Sign in"),
when="signed-out",
),
),
),
Expand All @@ -47,6 +49,8 @@ def index() -> rx.Component:
)
```

The package pins a compatible Clerk frontend set by default (`@clerk/react@6.6.0`, `@clerk/ui@1.9.0`, ClerkJS `6.10.0`). Apps that need another compatible set can call `clerk.configure_clerk_frontend_versions(...)` before creating Clerk components.

## Contributing

Feel free to open issues or make PRs.
Expand All @@ -69,4 +73,4 @@ I use [Taskfile](https://taskfile.dev/) (similar to `makefile`) to make common t

## TODO:

- How should the `condition` and `fallback` props be defined on `Protect`? They are supposed to be `Javascript` and `JSX` respectively, but are just `str` for now... Is `Javascript` `rx.Script`? And `JSX` `rx.Component`?
- Add migration notes for deprecated wrappers removed in the next major release.
41 changes: 25 additions & 16 deletions clerk_api_demo/clerk_api_demo/clerk_api_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def demo_page_header_and_description() -> rx.Component:
rx.link(rx.code("reflex"), href="https://reflex.dev"),
"components that wrap Clerk react components (",
rx.link(
rx.code("@clerk/clerk-react"),
href="https://www.npmjs.com/package/@clerk/clerk-react",
rx.code("@clerk/react"),
href="https://www.npmjs.com/package/@clerk/react",
),
") and interact with the Clerk backend API.",
size="4",
Expand Down Expand Up @@ -192,13 +192,15 @@ def getting_started() -> rx.Component:
def index() -> rx.Component:
return clerk.clerk_provider(
clerk.clerk_loaded(
clerk.signed_in(
clerk.show(
clerk.sign_on(
rx.button("Sign out"),
),
when="signed-in",
),
clerk.signed_out(
clerk.show(
rx.button("Sign in"),
when="signed-out",
),
),
publishable_key=os.environ["CLERK_PUBLISHABLE_KEY"],
Expand Down Expand Up @@ -439,19 +441,21 @@ def clerk_loaded_demo() -> rx.Component:
rx.vstack(
rx.text("You'll only see content below if you are signed in"),
rx.divider(),
clerk.signed_in(
clerk.show(
rx.text("You are signed in.", data_testid="you_are_signed_in"),
clerk.sign_out_button(rx.button("Sign out", width="100%")),
when="signed-in",
),
)
)
signed_out_area = rx.card(
rx.vstack(
rx.text("You'll only see content below if you are signed out"),
rx.divider(),
clerk.signed_out(
clerk.show(
rx.text("You are signed out.", data_testid="you_are_signed_out"),
clerk.sign_in_button(rx.button("Sign in", width="100%")),
when="signed-out",
),
)
)
Expand All @@ -477,7 +481,7 @@ def clerk_loaded_demo() -> rx.Component:
return demo_card(
"Clerk loaded and signed in/out areas",
rx.markdown(
"Demo of `clerk_loaded`, `clerk_loading`, and `signed_in`, `signed_out` components."
"Demo of `clerk_loaded`, `clerk_loading`, and `show` components."
),
demo,
)
Expand All @@ -496,18 +500,20 @@ def links_to_demo_pages() -> rx.Component:

But, you can also create your own with more customization.""")
),
clerk.signed_out(
clerk.show(
rx.grid(
rx.link(rx.button("Go to sign up page", width="100%"), href="/sign-up"),
rx.link(rx.button("Go to sign in page", width="100%"), href="/sign-in"),
width="100%",
columns="2",
spacing="3",
)
),
when="signed-out",
),
clerk.signed_in(
clerk.show(
rx.text("Sign out to see links to default sign-in and sign-up pages."),
clerk.sign_out_button(rx.button("Sign out", width="100%")),
when="signed-in",
),
)
return demo_card(
Expand All @@ -531,7 +537,7 @@ def user_info_demo() -> rx.Component:
Test credentials will not have a name or image by default.
""")
),
clerk.signed_in(
clerk.show(
rx.hstack(
rx.card(
rx.data_list.root(
Expand All @@ -548,9 +554,10 @@ def user_info_demo() -> rx.Component:
width="100%",
justify="center",
spacing="5",
)
),
when="signed-in",
),
clerk.signed_out(rx.text("Sign in to see user information.")),
clerk.show(rx.text("Sign in to see user information."), when="signed-out"),
)

return demo_card(
Expand Down Expand Up @@ -629,10 +636,11 @@ def demo_header() -> rx.Component:
data_list_item("password", rx.code("test-clerk-password")),
),
rx.hstack(
clerk.signed_in(
clerk.sign_out_button(rx.button("Sign out", data_testid="sign_out"))
clerk.show(
clerk.sign_out_button(rx.button("Sign out", data_testid="sign_out")),
when="signed-in",
),
clerk.signed_out(
clerk.show(
rx.hstack(
clerk.sign_in_button(
rx.button("Sign in", data_testid="sign_in")
Expand All @@ -641,6 +649,7 @@ def demo_header() -> rx.Component:
rx.button("Sign up", data_testid="sign_up")
),
),
when="signed-out",
),
),
),
Expand Down
48 changes: 41 additions & 7 deletions custom_components/reflex_clerk_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
__version__ = "1.2.4"
__version__ = "1.3.0"

from .authentication_components import sign_in, sign_up
from .base import (
CLERK_JS_VERSION,
CLERK_REACT_LIBRARY,
CLERK_REACT_VERSION,
CLERK_UI_LIBRARY,
CLERK_UI_VERSION,
DEFAULT_CLERK_FRONTEND_VERSIONS,
ClerkFrontendVersions,
configure_clerk_frontend_versions,
get_clerk_frontend_versions,
get_clerk_react_library,
get_clerk_ui_library,
reset_clerk_frontend_versions,
)
from .billing_components import pricing_table
from .clerk_provider import (
ClerkState,
ClerkUser,
Expand All @@ -13,10 +28,14 @@
from .control_components import (
clerk_loaded,
clerk_loading,
protect,
redirect_to_user_profile,
signed_in,
signed_out,
show,
)
from .organization_components import (
create_organization,
organization_list,
organization_profile,
organization_switcher,
)
from .pages import add_sign_in_page, add_sign_up_page
from .unstyled_components import (
Expand All @@ -28,6 +47,13 @@
from .user_components import user_button, user_profile

__all__ = [
"CLERK_JS_VERSION",
"CLERK_REACT_LIBRARY",
"CLERK_REACT_VERSION",
"CLERK_UI_LIBRARY",
"CLERK_UI_VERSION",
"DEFAULT_CLERK_FRONTEND_VERSIONS",
"ClerkFrontendVersions",
"ClerkState",
"ClerkUser",
"SignInButton",
Expand All @@ -36,17 +62,25 @@
"clerk_loaded",
"clerk_loading",
"clerk_provider",
"configure_clerk_frontend_versions",
"create_organization",
"get_clerk_frontend_versions",
"get_clerk_react_library",
"get_clerk_ui_library",
"on_load",
"protect",
"organization_list",
"organization_profile",
"organization_switcher",
"pricing_table",
"redirect_to_user_profile",
"register_on_auth_change_handler",
"reset_clerk_frontend_versions",
"show",
"sign_in",
"sign_in_button",
"sign_out_button",
"sign_up",
"sign_up_button",
"signed_in",
"signed_out",
"update_user_phone_number",
"user_button",
"user_profile",
Expand Down
Loading
Loading