Skip to content

Commit b1337df

Browse files
feat(clerk-js,types): Add __experimental_startPath to openOrganizationProfile (#5926)
1 parent 65f0878 commit b1337df

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.changeset/cute-hoops-find.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@clerk/clerk-js': minor
3+
'@clerk/types': minor
4+
---
5+
6+
Introduce `__experimental_startPath` option for `openOrganizationProfile`.
7+
8+
Example usage:
9+
10+
```ts
11+
clerk.openOrganizationProfile({
12+
__experimental_startPath: '/billing',
13+
});
14+
```

packages/clerk-js/src/ui/Components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ const Components = (props: ComponentsProps) => {
482482
onExternalNavigate={() => componentsControls.closeModal('organizationProfile')}
483483
startPath={buildVirtualRouterUrl({
484484
base: '/organizationProfile',
485-
path: urlStateParam?.path,
485+
path: organizationProfileModal?.__experimental_startPath || urlStateParam?.path,
486486
})}
487487
componentName={'OrganizationProfileModal'}
488488
modalContainerSx={{ alignItems: 'center' }}

packages/types/src/clerk.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,11 @@ export type OrganizationProfileProps = RoutingOptions & {
13101310
* Provide custom pages and links to be rendered inside the OrganizationProfile.
13111311
*/
13121312
customPages?: CustomPage[];
1313+
/**
1314+
* Specify on which page the organization profile modal will open.
1315+
* @experimental
1316+
**/
1317+
__experimental_startPath?: string;
13131318
};
13141319

13151320
export type OrganizationProfileModalProps = WithoutRouting<OrganizationProfileProps>;

0 commit comments

Comments
 (0)