Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: clerk/javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @clerk/themes@2.2.17
Choose a base ref
...
head repository: clerk/javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @clerk/themes@2.2.18
Choose a head ref
  • 13 commits
  • 125 files changed
  • 12 contributors

Commits on Feb 10, 2025

  1. fix(clerk-expo): Accept custom redirect URL for SSO callback (#5102)

    LauraBeatris authored Feb 10, 2025
    Copy the full SHA
    bc78aa2 View commit details

Commits on Feb 11, 2025

  1. fix(vue): Include missing UserProfileLink component inside `<UserBu…

    …tton />` component (#5128)
    wobsoriano authored Feb 11, 2025
    Copy the full SHA
    9b6102c View commit details
  2. chore(repo): Fix types

    triplechecker-com authored Feb 11, 2025
    Copy the full SHA
    82cf230 View commit details
  3. feat(astro): Add support for type-safe environment variables (#5104)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    wobsoriano and LekoArts authored Feb 11, 2025
    Copy the full SHA
    ab06832 View commit details
  4. feat(clerk-react,astro,vue): Add appearance option to modal components (

    #5125)
    
    Co-authored-by: Robert Soriano <sorianorobertc@gmail.com>
    alexcarpenter and wobsoriano authored Feb 11, 2025
    Copy the full SHA
    570d838 View commit details

Commits on Feb 12, 2025

  1. fix(localizations): Add legal consent localizations for hr-HR (#5131)

    Co-authored-by: panteliselef <panteliselef@outlook.com>
    harunsmrkovic and panteliselef authored Feb 12, 2025
    Copy the full SHA
    eab46bc View commit details
  2. chore(repo): Format

    nikosdouvlis committed Feb 12, 2025
    Copy the full SHA
    7d19f51 View commit details
  3. fix(upgrade): Remove unused getMajorVersion function (#5138)

    Co-authored-by: Nikos Douvlis <nikosdouvlis@gmail.com>
    LekoArts and nikosdouvlis authored Feb 12, 2025
    Copy the full SHA
    7076310 View commit details
  4. fix(clerk-js,types): Close modals when setActive({redirectUrl}) is …

    …called (#5092)
    panteliselef authored Feb 12, 2025
    Copy the full SHA
    dd2cbfe View commit details
  5. feat(agent-toolkit): Introduce @clerk/agent-toolkit package (#5130)

    Co-authored-by: Stefanos Anagnostou <anagstef@users.noreply.github.com>
    Co-authored-by: Lennart <lekoarts@gmail.com>
    3 people authored Feb 12, 2025
    Copy the full SHA
    128fd89 View commit details
  6. feat(vue): <OrganizationProfile> custom pages and links through `<O…

    …rganizationSwitcher>` (#5129)
    wobsoriano authored Feb 12, 2025
    Copy the full SHA
    98436f0 View commit details
  7. chore(repo): Clean up README.md (#5137)

    alexisintech authored Feb 12, 2025
    Copy the full SHA
    3b9a226 View commit details

Commits on Feb 13, 2025

  1. ci(repo): Version packages (#5127)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    clerk-cookie and github-actions[bot] authored Feb 13, 2025
    Copy the full SHA
    5cc1c78 View commit details
Showing with 2,440 additions and 637 deletions.
  1. +3 −0 .github/labeler.yml
  2. +44 −30 README.md
  3. +2 −2 docs/PUBLISH.md
  4. +83 −0 eslint.config.mjs
  5. +1 −1 integration/README.md
  6. +1 −1 integration/certs/README.md
  7. +37 −0 integration/templates/react-vite/src/buttons/index.tsx
  8. +5 −0 integration/templates/react-vite/src/main.tsx
  9. +1 −2 integration/templates/vue-vite/src/App.vue
  10. +8 −0 integration/templates/vue-vite/src/components/CustomUserButton.vue
  11. +4 −1 integration/templates/vue-vite/src/views/Home.vue
  12. +23 −1 integration/templates/vue-vite/src/views/custom-pages/OrganizationProfile.vue
  13. +5 −0 integration/testUtils/signInPageObject.ts
  14. +5 −0 integration/testUtils/signUpPageObject.ts
  15. +4 −2 integration/testUtils/userProfilePageObject.ts
  16. +4 −4 integration/tests/oauth-flows.test.ts
  17. +10 −0 integration/tests/sign-in-flow.test.ts
  18. +43 −0 integration/tests/sign-in-or-up-flow.test.ts
  19. +32 −1 integration/tests/sign-up-flow.test.ts
  20. +52 −0 integration/tests/user-profile.test.ts
  21. +63 −1 integration/tests/vue/components.test.ts
  22. +16 −0 packages/agent-toolkit/CHANGELOG.md
  23. +21 −0 packages/agent-toolkit/LICENSE
  24. +230 −0 packages/agent-toolkit/README.md
  25. +67 −0 packages/agent-toolkit/package.json
  26. +15 −0 packages/agent-toolkit/src/ai-sdk/adapter.ts
  27. +48 −0 packages/agent-toolkit/src/ai-sdk/index.ts
  28. +6 −0 packages/agent-toolkit/src/global.d.ts
  29. +16 −0 packages/agent-toolkit/src/langchain/adapter.ts
  30. +53 −0 packages/agent-toolkit/src/langchain/index.ts
  31. +23 −0 packages/agent-toolkit/src/lib/clerk-client.ts
  32. +55 −0 packages/agent-toolkit/src/lib/clerk-tool.ts
  33. +5 −0 packages/agent-toolkit/src/lib/constants.ts
  34. +18 −0 packages/agent-toolkit/src/lib/inject-session-claims.ts
  35. +15 −0 packages/agent-toolkit/src/lib/tools/index.ts
  36. +52 −0 packages/agent-toolkit/src/lib/tools/user-tools.ts
  37. +43 −0 packages/agent-toolkit/src/lib/types.ts
  38. +66 −0 packages/agent-toolkit/src/lib/utils.ts
  39. +19 −0 packages/agent-toolkit/tsconfig.json
  40. +6 −0 packages/agent-toolkit/tsconfig.test.json
  41. +25 −0 packages/agent-toolkit/tsup.config.ts
  42. +33 −3 packages/astro/CHANGELOG.md
  43. +4 −2 packages/astro/package.json
  44. +6 −6 packages/astro/src/astro-components/unstyled/SignInButton.astro
  45. +1 −1 packages/astro/src/astro-components/unstyled/SignOutButton.astro
  46. +6 −6 packages/astro/src/astro-components/unstyled/SignUpButton.astro
  47. +31 −1 packages/astro/src/integration/create-integration.ts
  48. +40 −38 packages/astro/src/react/SignInButton.tsx
  49. +45 −43 packages/astro/src/react/SignUpButton.tsx
  50. +5 −19 packages/astro/src/react/types.ts
  51. +0 −1 packages/astro/src/types.ts
  52. +3 −2 packages/astro/tsconfig.json
  53. +14 −4 packages/backend/CHANGELOG.md
  54. +1 −1 packages/backend/package.json
  55. +9 −1 packages/backend/src/api/resources/User.ts
  56. +11 −2 packages/chrome-extension/CHANGELOG.md
  57. +1 −1 packages/chrome-extension/README.md
  58. +1 −1 packages/chrome-extension/package.json
  59. +25 −14 packages/clerk-js/CHANGELOG.md
  60. +1 −1 packages/clerk-js/package.json
  61. +24 −10 packages/clerk-js/src/core/clerk.ts
  62. +3 −1 packages/clerk-js/src/ui/Components.tsx
  63. +1 −1 packages/clerk-js/src/ui/lazyModules/providers.tsx
  64. +9 −8 packages/clerk-js/src/ui/router/BaseRouter.tsx
  65. +2 −0 packages/clerk-js/src/ui/router/PathRouter.tsx
  66. +16 −3 packages/clerk-js/src/ui/router/VirtualRouter.tsx
  67. +11 −2 packages/elements/CHANGELOG.md
  68. +1 −1 packages/elements/package.json
  69. +8 −0 packages/expo-passkeys/CHANGELOG.md
  70. +1 −1 packages/expo-passkeys/package.json
  71. +25 −2 packages/expo/CHANGELOG.md
  72. +1 −1 packages/expo/package.json
  73. +14 −5 packages/expo/src/hooks/useSSO.ts
  74. +9 −0 packages/express/CHANGELOG.md
  75. +1 −1 packages/express/package.json
  76. +9 −0 packages/fastify/CHANGELOG.md
  77. +1 −1 packages/fastify/package.json
  78. +12 −3 packages/localizations/CHANGELOG.md
  79. +1 −1 packages/localizations/package.json
  80. +6 −5 packages/localizations/src/hr-HR.ts
  81. +16 −6 packages/nextjs/CHANGELOG.md
  82. +1 −1 packages/nextjs/package.json
  83. +10 −0 packages/nuxt/CHANGELOG.md
  84. +1 −1 packages/nuxt/package.json
  85. +10 −0 packages/react-router/CHANGELOG.md
  86. +1 −1 packages/react-router/package.json
  87. +16 −4 packages/react/CHANGELOG.md
  88. +1 −1 packages/react/package.json
  89. +4 −4 packages/react/src/components/SignInButton.tsx
  90. +4 −4 packages/react/src/components/SignUpButton.tsx
  91. +1 −0 packages/react/src/isomorphicClerk.ts
  92. +2 −29 packages/react/src/types.ts
  93. +14 −4 packages/remix/CHANGELOG.md
  94. +1 −1 packages/remix/package.json
  95. +9 −2 packages/shared/CHANGELOG.md
  96. +1 −1 packages/shared/package.json
  97. +10 −0 packages/tanstack-start/CHANGELOG.md
  98. +1 −1 packages/tanstack-start/package.json
  99. +9 −0 packages/testing/CHANGELOG.md
  100. +1 −1 packages/testing/package.json
  101. +8 −1 packages/themes/CHANGELOG.md
  102. +1 −1 packages/themes/package.json
  103. +15 −7 packages/types/CHANGELOG.md
  104. +1 −1 packages/types/package.json
  105. +40 −0 packages/types/src/clerk.ts
  106. +11 −1 packages/ui/CHANGELOG.md
  107. +1 −1 packages/ui/package.json
  108. +6 −0 packages/upgrade/CHANGELOG.md
  109. +1 −1 packages/upgrade/package.json
  110. +0 −9 packages/upgrade/src/app.js
  111. +0 −6 packages/upgrade/src/util/get-clerk-version.js
  112. +1 −1 packages/upgrade/src/versions/core-2/chrome-extension/clerkprovider-tokencache.md
  113. +73 −0 packages/vue/CHANGELOG.md
  114. +1 −1 packages/vue/package.json
  115. +2 −14 packages/vue/src/components/SignInButton.vue
  116. +2 −11 packages/vue/src/components/SignUpButton.vue
  117. +1 −2 packages/vue/src/components/index.ts
  118. +0 −17 packages/vue/src/components/ui-components/OrganizationSwitcher.vue
  119. +40 −0 packages/vue/src/components/ui-components/OrganizationSwitcher/OrganizationSwitcher.vue
  120. +7 −0 packages/vue/src/components/ui-components/OrganizationSwitcher/index.ts
  121. +2 −1 packages/vue/src/components/ui-components/UserButton/index.ts
  122. +1 −1 playground/browser-extension/README.md
  123. +490 −261 pnpm-lock.yaml
  124. +1 −0 scripts/canary.mjs
  125. +1 −0 scripts/snapshot.mjs
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -65,3 +65,6 @@ actions:

integration:
- integration/**

agent-toolkit:
- packages/agent-toolkit/**
74 changes: 44 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,61 +7,75 @@
</a>
<br />
</p>
<h1 align="center">
Official Clerk JavaScript SDKs
</h1>
<p align="center">
<strong>
Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile.
</strong>
</p>

This repository contains all the Clerk JavaScript SDKs under the `@clerk` namespace. Visit [clerk.com](https://clerk.com) to signup for an account.

[![chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)
[![documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs)
[![twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)
<div align="center">
<h1>
Official Clerk JavaScript SDKs
</h1>
<a href="https://www.npmjs.com/package/@clerk/clerk-js">
<img alt="Downloads" src="https://img.shields.io/npm/dm/@clerk/clerk-js" />
</a>
<a href="https://clerk.com/docs">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-clerk-green.svg" />
</a>
<a href="https://discord.com/invite/b5rXHjAg7A">
<img alt="Discord" src="https://img.shields.io/discord/856971667393609759?color=7389D8&label&logo=discord&logoColor=ffffff" />
</a>
<a href="https://twitter.com/clerkdev">
<img alt="Twitter" src="https://img.shields.io/twitter/url.svg?label=%40clerkdev&style=social&url=https%3A%2F%2Ftwitter.com%2Fclerkdev" />
</a>
<br />
<br />
<p>
<strong>
Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile.
</strong>
</p>
<p>
This repository contains all the Clerk JavaScript SDKs under the <code>@clerk</code> namespace.
</p>
</div>

---

**Clerk is Hiring!**
💼 **Clerk is hiring!**

Would you like to work on Open Source software and help maintain this repository? [Apply today!](https://jobs.ashbyhq.com/clerk).
Would you like to work on Open Source software and help maintain this repository? [Apply today](https://jobs.ashbyhq.com/clerk)!

---

## 🚀 Get Started with Clerk
## 🚀 Get started with Clerk

1. [Sign up for an account](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_js_repo_readme)
1. Create an application in your Clerk dashboard
1. Spin up a new codebase with one of the [quickstart guides](https://clerk.com/docs/quickstarts/overview?utm_source=github&utm_medium=clerk_js_repo_readme)
1. [Sign up for an account](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_js_repo_readme).
1. Create an application in your Clerk Dashboard.
1. Spin up a new codebase with one of the [quickstart guides](https://clerk.com/docs/quickstarts/overview?utm_source=github&utm_medium=clerk_js_repo_readme).

This repository contains the SDKs for environment/platforms that Clerk supports. For example, if you want to use Clerk with Node.js you can install:
This repository contains the SDKs for environment/platforms that Clerk supports. For example, if you want to use Clerk with Next.js, you can install:

```sh
npm install @clerk/backend
npm install @clerk/nextjs
# or
yarn add @clerk/backend
yarn add @clerk/nextjs
# or
pnpm add @clerk/backend
pnpm add @clerk/nextjs
```

## 🎓 Learning Clerk

Clerk's full documentation is available at [clerk.com/docs](https://clerk.com/docs?utm_source=github&utm_medium=clerk_js_repo_readme).

- **We recommend starting with the [Quickstart guides](https://clerk.com/docs/quickstarts/overview).** It'll enable you to quickly add Clerk to your application. If you're starting a new project and are not sure what to pick, use [Next.js](https://nextjs.org/docs/getting-started/installation) and [@clerk/nextjs](https://clerk.com/docs/quickstarts/nextjs).
- **To learn more about Clerk's components and features, checkout the rest of the [Clerk documentation](https://clerk.com/docs?utm_source=github&utm_medium=clerk_js_repo_readme).** You'll be able to e.g. browse the [component reference](https://clerk.com/docs/components/overview?utm_source=github&utm_medium=clerk_js_repo_readme) page.
- **We recommend starting with the [quickstart guides](https://clerk.com/docs/quickstarts/overview?utm_source=github&utm_medium=clerk_js_repo_readme).** They'll help you quickly add Clerk to your application. If you're starting a new project and aren't sure what to pick, check out our most popular quickstart: [Next.js](https://clerk.com/docs/quickstarts/nextjs?utm_source=github&utm_medium=clerk_js_repo_readme).
- Clerk offers a comprehensive suite of components designed to seamlessly integrate authentication and multi-tenancy into your application. To learn more about **Clerk's components**, check out [the docs](https://clerk.com/docs/components/overview?utm_source=github&utm_medium=clerk_js_repo_readme).
- Clerk's **organizations** feature provides powerful multi-tenancy capabilities, allowing you to group users, manage roles and permissions, and control access to resources. Perfect for B2B applications, enterprise software, and any multi-tenant system. Learn more [in the docs](https://clerk.com/docs/organizations/overview?utm_source=github&utm_medium=clerk_js_repo_readme).

## 🚢 Release Notes
## 🚢 Release notes

Curious what we shipped recently? You can browse the [GitHub Releases](https://github.com/clerk/javascript/releases) page or look at the individual `CHANGELOG.md` files inside each package (e.g. [`clerk-js CHANGELOG`](https://github.com/clerk/javascript/blob/main/packages/clerk-js/CHANGELOG.md)).

## 🤝 How to Contribute
## 🤝 How to contribute

We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md). We'd love to have you as part of the Clerk community!
We'd love to have you as part of the Clerk community! 💜

It'll show you how to make changes to the SDKs, open pull requests, or submitting issues. If you want to add or edit localizations (e.g. how a button text is translated to your language), you can check out the [`localizations` README](./packages/localizations/README.md).
If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md). They'll show you how to submit issues, make changes to the SDKs, or open pull requests. If you want to add or edit localizations (e.g. how a button text is translated to your language), you can check out the [`localizations` README](./packages/localizations/README.md).

## 📝 License

4 changes: 2 additions & 2 deletions docs/PUBLISH.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ To release a new stable version of all Clerk packages, find the "ci(repo): Versi

An automated canary release will be take place every time a PR gets merged into `main`.

- Staging versions use the following format: `@clerk/package@x.y.z-canary.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `canary` is a stable prerelease mame and `commit` is the id of the last commit in the branch.
- Staging versions use the following format: `@clerk/package@x.y.z-canary.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `canary` is a stable prerelease name and `commit` is the id of the last commit in the branch.
- Currently, canary version changes are _not_ committed to the repo and no git tags will be generated. Using this strategy, we avoid merge conflicts, allowing us to constantly deploy canary versions without switching the repo to a "prerelease" mode.
- During a canary release, `@clerk/clerk-js` will also be released. If needed, use the `clerkJSVersion` prop to use a specific version, eg: `<ClerkProvider clerkJSVersion='4.1.1-canary.90012' />`
- A package will not be published if it's not affected by a changeset.
@@ -35,7 +35,7 @@ To perform a snapshot release, simply comment `!snapshot` in your PR. Once the p

Notes:

- Snapshot versions use the following format: `@clerk/package@x.y.z-snapshot.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `snapshot` is a stable prerelease mame and `commit` is the id of the last commit in the branch.
- Snapshot versions use the following format: `@clerk/package@x.y.z-snapshot.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `snapshot` is a stable prerelease name and `commit` is the id of the last commit in the branch.
- If you want to name your snapshot release, you can pass an argument to the snapshot comment, eg `!snapshot myname` will use `myname` instead of `snapshot`, eg: `@clerk/clerk-js@4.1.1-myname.90012`. Please note: When using a custom name, the underlying id stays the same and only the tag changes. This has the consequence that npm resolves versions alphabetically. You should pin your versions and not rely on resolving through `^` or `~`.
- Snapshot version changes are _not_ committed to the repo and no git tags will be generated - they are meant to be used as "snapshots" of the repo at a particular state for testing purposes.
- During a snapshot release, `@clerk/clerk-js` will also be released. If needed, use the `clerkJSVersion` prop to use a specific version, eg: `<ClerkProvider clerkJSVersion='4.1.1-snapshot.90012' />`
83 changes: 83 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -19,6 +19,75 @@ const ECMA_VERSION = 2021,
TEST_FILES = ['**/*.test.js', '**/*.test.jsx', '**/*.test.ts', '**/*.test.tsx', '**/test/**', '**/__tests__/**'],
TYPESCRIPT_FILES = ['**/*.cts', '**/*.mts', '**/*.ts', '**/*.tsx'];

const noNavigateUseClerk = {
meta: {
type: 'problem',
docs: {
description: 'Disallow any usage of `navigate` from `useClerk()`',
recommended: false,
},
messages: {
noNavigate:
'Usage of `navigate` from `useClerk()` is not allowed.\nUse `useRouter().navigate` to navigate in-between flows or `setActive({ redirectUrl })`.',
},
schema: [],
},
create(context) {
const sourceCode = context.getSourceCode();

return {
// Case 1: Destructuring `navigate` from `useClerk()`
VariableDeclarator(node) {
if (
node.id.type === 'ObjectPattern' && // Checks if it's an object destructuring
node.init?.type === 'CallExpression' &&
node.init.callee.name === 'useClerk'
) {
for (const property of node.id.properties) {
if (property.type === 'Property' && property.key.name === 'navigate') {
context.report({
node: property,
messageId: 'noNavigate',
});
}
}
}
},

// Case 2 & 3: Accessing `navigate` on a variable or directly calling `useClerk().navigate`
MemberExpression(node) {
if (
node.property.name === 'navigate' &&
node.object.type === 'CallExpression' &&
node.object.callee.name === 'useClerk'
) {
// Case 3: Direct `useClerk().navigate`
context.report({
node,
messageId: 'noNavigate',
});
} else if (node.property.name === 'navigate' && node.object.type === 'Identifier') {
// Case 2: `clerk.navigate` where `clerk` is assigned `useClerk()`
const scope = sourceCode.scopeManager.acquire(node);
if (!scope) return;

const variable = scope.variables.find(v => v.name === node.object.name);

if (
variable?.defs?.[0]?.node?.init?.type === 'CallExpression' &&
variable.defs[0].node.init.callee.name === 'useClerk'
) {
context.report({
node,
messageId: 'noNavigate',
});
}
}
},
};
},
};

export default tseslint.config([
{
name: 'repo/ignores',
@@ -285,6 +354,20 @@ export default tseslint.config([
'react-hooks/rules-of-hooks': 'warn',
},
},
{
name: 'packages/clerk-js',
files: ['packages/clerk-js/src/ui/**/*'],
plugins: {
'custom-rules': {
rules: {
'no-navigate-useClerk': noNavigateUseClerk,
},
},
},
rules: {
'custom-rules/no-navigate-useClerk': 'error',
},
},
{
name: 'packages/expo-passkeys',
files: ['packages/expo-passkeys/src/**/*'],
2 changes: 1 addition & 1 deletion integration/README.md
Original file line number Diff line number Diff line change
@@ -565,7 +565,7 @@ Currently, `u` has:
This handler runs in the context of a new browser, as the second browser is completely isolated. The nested `u` variable shadows the `u` variable of the parent scope to make this distinction apparent.
> [!TIP]
> You can find more details in the [source code](./testUtils/index.ts) of `createTestUtils`. For example inside [`appPageObject`](./testUtils/appPageObject.ts) you can find out that `u.page` allows you to programatically go to the index page through `u.page.goToStart()`.
> You can find more details in the [source code](./testUtils/index.ts) of `createTestUtils`. For example inside [`appPageObject`](./testUtils/appPageObject.ts) you can find out that `u.page` allows you to programmatically go to the index page through `u.page.goToStart()`.
## Concepts
2 changes: 1 addition & 1 deletion integration/certs/README.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ During installation, `mkcert` automatically adds its root CA to your machine's t
export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"
```

or provide the `NODE_EXTRA_CA_CERTS` when runnning your tests:
or provide the `NODE_EXTRA_CA_CERTS` when running your tests:

```shell
NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" playwright test...
37 changes: 37 additions & 0 deletions integration/templates/react-vite/src/buttons/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';

export default function Home() {
return (
<main>
<SignInButton
mode='modal'
forceRedirectUrl='/protected'
signUpForceRedirectUrl='/protected'
>
Sign in button (force)
</SignInButton>

<SignInButton
mode='modal'
fallbackRedirectUrl='/protected'
>
Sign in button (fallback)
</SignInButton>

<SignUpButton
mode='modal'
forceRedirectUrl='/protected'
signInForceRedirectUrl='/protected'
>
Sign up button (force)
</SignUpButton>

<SignUpButton
mode='modal'
fallbackRedirectUrl='/protected'
>
Sign up button (fallback)
</SignUpButton>
</main>
);
}
5 changes: 5 additions & 0 deletions integration/templates/react-vite/src/main.tsx
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ import OrganizationProfile from './organization-profile';
import OrganizationList from './organization-list';
import CreateOrganization from './create-organization';
import OrganizationSwitcher from './organization-switcher';
import Buttons from './buttons';

const Root = () => {
const navigate = useNavigate();
@@ -68,6 +69,10 @@ const router = createBrowserRouter([
path: '/protected',
element: <Protected />,
},
{
path: '/buttons',
element: <Buttons />,
},
{
path: '/custom-user-profile/*',
element: <UserProfileCustom />,
3 changes: 1 addition & 2 deletions integration/templates/vue-vite/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { SignedIn, SignedOut, OrganizationSwitcher, ClerkLoaded, ClerkLoading } from '@clerk/vue';
import { SignedIn, SignedOut, ClerkLoaded, ClerkLoading } from '@clerk/vue';
import CustomUserButton from './components/CustomUserButton.vue';
</script>

@@ -11,7 +11,6 @@ import CustomUserButton from './components/CustomUserButton.vue';
</div>
<SignedIn>
<CustomUserButton />
<OrganizationSwitcher />
</SignedIn>
<SignedOut>
<RouterLink to="/sign-in">Sign in</RouterLink>
Original file line number Diff line number Diff line change
@@ -47,6 +47,14 @@ const isActionClicked = ref(false);
<p>This is the custom terms page</p>
</div>
</UserButton.UserProfilePage>
<UserButton.UserProfileLink
label="Homepage"
url="/"
>
<template #labelIcon>
<div>Icon</div>
</template>
</UserButton.UserProfileLink>
</UserButton>
<div>Is action clicked: {{ isActionClicked }}</div>
</template>
5 changes: 4 additions & 1 deletion integration/templates/vue-vite/src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { useAuth } from '@clerk/vue';
import { SignedIn, OrganizationSwitcher, useAuth } from '@clerk/vue';
const { isSignedIn } = useAuth();
</script>

<template>
<SignedIn>
<OrganizationSwitcher />
</SignedIn>
<div>
<ul>
<li v-if="isSignedIn"><RouterLink to="/profile">Profile</RouterLink></li>
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
<script setup lang="ts">
import { OrganizationProfile } from '@clerk/vue';
import { OrganizationProfile, OrganizationSwitcher } from '@clerk/vue';
</script>

<template>
<OrganizationSwitcher>
<OrganizationSwitcher.OrganizationProfilePage
label="Terms"
url="terms"
>
<template #labelIcon>
<div>Icon</div>
</template>
<div>
<h1>Custom Terms Page</h1>
<p>This is the custom terms page</p>
</div>
</OrganizationSwitcher.OrganizationProfilePage>
<OrganizationSwitcher.OrganizationProfileLink
label="Homepage"
url="/"
>
<template #labelIcon>
<div>Icon</div>
</template>
</OrganizationSwitcher.OrganizationProfileLink>
</OrganizationSwitcher>
<OrganizationProfile>
<OrganizationProfile.Page
label="Terms"
5 changes: 5 additions & 0 deletions integration/testUtils/signInPageObject.ts
Original file line number Diff line number Diff line change
@@ -24,6 +24,11 @@ export const createSignInComponentPageObject = (testArgs: TestArgs) => {
waitForMounted: (selector = '.cl-signIn-root') => {
return page.waitForSelector(selector, { state: 'attached' });
},
waitForModal: (state?: 'open' | 'closed') => {
return page.waitForSelector('.cl-modalContent:has(.cl-signIn-root)', {
state: state === 'closed' ? 'detached' : 'attached',
});
},
setIdentifier: (val: string) => {
return self.getIdentifierInput().fill(val);
},
Loading