From 2846752e024f8c7bab48afd89afdfee7021b63fa Mon Sep 17 00:00:00 2001
From: PJ-Snap <144244861+PJ-Snap@users.noreply.github.com>
Date: Thu, 24 Jul 2025 14:14:24 +0100
Subject: [PATCH 1/2] Update organization_components.py
adds support for clerk organization components
---
.../organization_components.py | 132 ++++++++++++++++++
1 file changed, 132 insertions(+)
diff --git a/custom_components/reflex_clerk_api/organization_components.py b/custom_components/reflex_clerk_api/organization_components.py
index e69de29..d91337a 100644
--- a/custom_components/reflex_clerk_api/organization_components.py
+++ b/custom_components/reflex_clerk_api/organization_components.py
@@ -0,0 +1,132 @@
+from typing import Optional
+from reflex_clerk_api.base import ClerkBase
+
+
+class CreateOrganization(ClerkBase):
+ """
+ The CreateOrganization component provides a form for users to create new organizations.
+
+ This component renders Clerk's React component,
+ allowing users to set up new organizations with customizable appearance and routing.
+
+ Props:
+ appearance: Optional object to style your components. Will only affect Clerk components.
+ path: The path where the component is mounted when routing is set to 'path'.
+ routing: The routing strategy for your pages. Defaults to 'path' for frameworks
+ that handle routing, or 'hash' for other SDKs.
+ after_create_organization_url: The full URL or path to navigate to after creating an organization.
+ fallback: An optional element to be rendered while the component is mounting.
+ """
+
+ tag = "CreateOrganization"
+
+ # Optional props that CreateOrganization supports
+ appearance: Optional[str] = None
+ path: Optional[str] = None
+ routing: Optional[str] = None
+ after_create_organization_url: Optional[str] = None
+ fallback: Optional[str] = None
+
+
+class OrganizationProfile(ClerkBase):
+ """
+ The OrganizationProfile component allows users to manage their organization membership and security settings.
+
+ This component renders Clerk's React component,
+ allowing users to manage organization information, members, billing, and security settings.
+
+ Props:
+ appearance: Optional object to style your components. Will only affect Clerk components.
+ path: The path where the component is mounted when routing is set to 'path'.
+ routing: The routing strategy for your pages. Defaults to 'path' for frameworks
+ that handle routing, or 'hash' for other SDKs.
+ after_leave_organization_url: The full URL or path to navigate to after leaving an organization.
+ custom_pages: An array of custom pages to add to the organization profile.
+ fallback: An optional element to be rendered while the component is mounting.
+ """
+
+ tag = "OrganizationProfile"
+
+ # Optional props that OrganizationProfile supports
+ appearance: Optional[str] = None
+ path: Optional[str] = None
+ routing: Optional[str] = None
+ after_leave_organization_url: Optional[str] = None
+ custom_pages: Optional[str] = None
+ fallback: Optional[str] = None
+
+
+class OrganizationSwitcher(ClerkBase):
+ """
+ The OrganizationSwitcher component displays the currently active organization and allows users to switch between organizations.
+
+ This component renders Clerk's React component,
+ providing a dropdown interface for organization switching with customizable appearance.
+
+ Props:
+ appearance: Optional object to style your components. Will only affect Clerk components.
+ organization_profile_mode: Controls whether selecting the organization opens as a modal or navigates to a page.
+ organization_profile_url: The full URL or path leading to the organization management interface.
+ create_organization_mode: Controls whether selecting create organization opens as a modal or navigates to a page.
+ create_organization_url: The full URL or path leading to the create organization interface.
+ after_leave_organization_url: The full URL or path to navigate to after leaving an organization.
+ after_create_organization_url: The full URL or path to navigate to after creating an organization.
+ after_select_organization_url: The full URL or path to navigate to after selecting an organization.
+ default_open: Controls whether the OrganizationSwitcher should open by default during the first render.
+ hide_personal_account: Controls whether the personal account option is hidden in the switcher.
+ fallback: An optional element to be rendered while the component is mounting.
+ """
+
+ tag = "OrganizationSwitcher"
+
+ # Optional props that OrganizationSwitcher supports
+ appearance: Optional[str] = None
+ organization_profile_mode: Optional[str] = None
+ organization_profile_url: Optional[str] = None
+ create_organization_mode: Optional[str] = None
+ create_organization_url: Optional[str] = None
+ after_leave_organization_url: Optional[str] = None
+ after_create_organization_url: Optional[str] = None
+ after_select_organization_url: Optional[str] = None
+ default_open: Optional[str] = None
+ hide_personal_account: Optional[str] = None
+ fallback: Optional[str] = None
+
+
+class OrganizationList(ClerkBase):
+ """
+ The OrganizationList component displays a list of organizations that the user is a member of.
+
+ This component renders Clerk's React component,
+ providing an interface to view and manage organization memberships.
+
+ Props:
+ appearance: Optional object to style your components. Will only affect Clerk components.
+ after_create_organization_url: The full URL or path to navigate to after creating an organization.
+ after_select_organization_url: The full URL or path to navigate to after selecting an organization.
+ after_select_personal_url: The full URL or path to navigate to after selecting the personal account.
+ create_organization_mode: Controls whether selecting create organization opens as a modal or navigates to a page.
+ create_organization_url: The full URL or path leading to the create organization interface.
+ hide_personal_account: Controls whether the personal account option is hidden in the list.
+ skip_invitation_screen: Controls whether to skip the invitation screen when creating an organization.
+ fallback: An optional element to be rendered while the component is mounting.
+ """
+
+ tag = "OrganizationList"
+
+ # Optional props that OrganizationList supports
+ appearance: Optional[str] = None
+ after_create_organization_url: Optional[str] = None
+ after_select_organization_url: Optional[str] = None
+ after_select_personal_url: Optional[str] = None
+ create_organization_mode: Optional[str] = None
+ create_organization_url: Optional[str] = None
+ hide_personal_account: Optional[str] = None
+ skip_invitation_screen: Optional[str] = None
+ fallback: Optional[str] = None
+
+
+create_organization = CreateOrganization.create
+organization_profile = OrganizationProfile.create
+organization_switcher = OrganizationSwitcher.create
+organization_list = OrganizationList.create
From 30a467d869fd572f278e8a23711a60bf4f09bde0 Mon Sep 17 00:00:00 2001
From: Tim Child
Date: Fri, 22 Aug 2025 09:35:27 -0400
Subject: [PATCH 2/2] minor format
---
custom_components/reflex_clerk_api/organization_components.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/custom_components/reflex_clerk_api/organization_components.py b/custom_components/reflex_clerk_api/organization_components.py
index d91337a..3883d0e 100644
--- a/custom_components/reflex_clerk_api/organization_components.py
+++ b/custom_components/reflex_clerk_api/organization_components.py
@@ -1,4 +1,5 @@
from typing import Optional
+
from reflex_clerk_api.base import ClerkBase