Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 0 additions & 43 deletions packages/react/docs/use-auth.md

This file was deleted.

20 changes: 0 additions & 20 deletions packages/react/docs/use-sign-in.md

This file was deleted.

20 changes: 0 additions & 20 deletions packages/react/docs/use-sign-up.md

This file was deleted.

25 changes: 0 additions & 25 deletions packages/react/src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,10 @@ type UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined |
/**
* The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.
*
* > [!NOTE]
* > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).
*
* <If sdk="nextjs">
* By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.
* </If>
*
* @unionReturnHeadings
* ["Initialization", "Signed out", "Signed in (no active organization)", "Signed in (with active organization)"]
*
* @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.
*
* @function
*
* @example
*
* The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.
*
* <Tabs items='React,Next.js'>
* <Tab>
*
* ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}
* import { useAuth } from '@clerk/clerk-react'
*
Expand Down Expand Up @@ -83,14 +66,6 @@ type UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined |
* )
* }
* ```
*
* </Tab>
* <Tab>
*
* {@include ../../docs/use-auth.md#nextjs-01}
*
* </Tab>
* </Tabs>
*/
export const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {
useAssertWrappedByClerkProvider('useAuth');
Expand Down
17 changes: 0 additions & 17 deletions packages/react/src/hooks/useSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ import { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvid
/**
* The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview#sign-in-flow).
*
* @unionReturnHeadings
* ["Initialization", "Loaded"]
*
* @example
* ### Check the current state of a sign-in
*
* The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.
*
* <Tabs items='React,Next.js'>
* <Tab>
*
* ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}
* import { useSignIn } from '@clerk/clerk-react'
*
Expand All @@ -34,20 +27,10 @@ import { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvid
* }
* ```
*
* </Tab>
* <Tab>
*
* {@include ../../docs/use-sign-in.md#nextjs-01}
*
* </Tab>
* </Tabs>
*
* @example
* ### Create a custom sign-in flow with `useSignIn()`
*
* The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).
*
* ```empty```
*/
export const useSignIn = (): UseSignInReturn => {
useAssertWrappedByClerkProvider('useSignIn');
Expand Down
17 changes: 0 additions & 17 deletions packages/react/src/hooks/useSignUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ import { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvid
/**
* The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview#sign-up-flow).
*
* @unionReturnHeadings
* ["Initialization", "Loaded"]
*
* @example
* ### Check the current state of a sign-up
*
* The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.
*
* <Tabs items='React,Next.js'>
* <Tab>
*
* ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}
* import { useSignUp } from '@clerk/clerk-react'
*
Expand All @@ -34,20 +27,10 @@ import { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvid
* }
* ```
*
* </Tab>
* <Tab>
*
* {@include ../../docs/use-sign-up.md#nextjs-01}
*
* </Tab>
* </Tabs>
*
* @example
* ### Create a custom sign-up flow with `useSignUp()`
*
* The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).
*
* ```empty```
*/
export const useSignUp = (): UseSignUpReturn => {
useAssertWrappedByClerkProvider('useSignUp');
Expand Down
15 changes: 0 additions & 15 deletions packages/shared/docs/use-clerk.md

This file was deleted.

24 changes: 0 additions & 24 deletions packages/shared/docs/use-session-list.md

This file was deleted.

28 changes: 0 additions & 28 deletions packages/shared/docs/use-session.md

This file was deleted.

81 changes: 0 additions & 81 deletions packages/shared/docs/use-user.md

This file was deleted.

17 changes: 0 additions & 17 deletions packages/shared/src/react/hooks/useClerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@ import { useAssertWrappedByClerkProvider, useClerkInstanceContext } from '../con
*
* The `useClerk()` hook provides access to the [`Clerk`](https://clerk.com/docs/reference/javascript/clerk) object, allowing you to build alternatives to any Clerk Component.
*
* @function
*
* @returns The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](https://clerk.com/docs/reference/javascript/clerk).
*
* @example
*
* The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](https://clerk.com/docs/reference/javascript/clerk#sign-in) method to open the sign-in modal.
*
* <Tabs items='React,Next.js'>
* <Tab>
*
* ```tsx {{ filename: 'src/Home.tsx' }}
* import { useClerk } from '@clerk/clerk-react'
*
Expand All @@ -28,14 +19,6 @@ import { useAssertWrappedByClerkProvider, useClerkInstanceContext } from '../con
* return <button onClick={() => clerk.openSignIn({})}>Sign in</button>
* }
* ```
*
* </Tab>
* <Tab>
*
* {@include ../../../docs/use-clerk.md#nextjs-01}
*
* </Tab>
* </Tabs>
*/
export const useClerk = (): LoadedClerk => {
useAssertWrappedByClerkProvider('useClerk');
Expand Down
Loading