From fa18f2883a266800bcfd536bc5bfb5b712b41c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BB=D0=B8=D0=B9=20=D0=95=D0=BB?= =?UTF-8?q?=D0=B8=D1=81=D0=B5=D0=B5=D0=B2?= Date: Mon, 4 May 2026 14:44:49 +0600 Subject: [PATCH] feat: remove clerk feature --- README.md | 153 - package-lock.json | 2481 +---------------- package.json | 2 - src/lib/package.json | 10 +- src/lib/src/features/clerk/enums/api-error.ts | 11 - src/lib/src/features/clerk/enums/index.ts | 1 - src/lib/src/features/clerk/hooks/index.ts | 10 - .../clerk/hooks/use-add-identifier.ts | 89 - .../clerk/hooks/use-auth-with-identifier.ts | 219 -- .../features/clerk/hooks/use-auth-with-sso.ts | 63 - .../clerk/hooks/use-auth-with-ticket.ts | 70 - .../clerk/hooks/use-clerk-resources.ts | 21 - .../clerk/hooks/use-get-session-token.ts | 39 - .../clerk/hooks/use-otp-verification.ts | 123 - .../clerk/hooks/use-reset-password.ts | 104 - .../clerk/hooks/use-update-identifier.ts | 106 - .../clerk/hooks/use-update-password.ts | 37 - src/lib/src/features/clerk/index.ts | 3 - src/lib/src/features/clerk/types/index.ts | 1 - src/lib/src/features/clerk/types/types.ts | 602 ---- tsconfig.base.json | 3 +- 21 files changed, 94 insertions(+), 4054 deletions(-) delete mode 100644 src/lib/src/features/clerk/enums/api-error.ts delete mode 100644 src/lib/src/features/clerk/enums/index.ts delete mode 100644 src/lib/src/features/clerk/hooks/index.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-add-identifier.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-auth-with-sso.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-auth-with-ticket.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-clerk-resources.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-get-session-token.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-otp-verification.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-reset-password.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-update-identifier.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-update-password.ts delete mode 100644 src/lib/src/features/clerk/index.ts delete mode 100644 src/lib/src/features/clerk/types/index.ts delete mode 100644 src/lib/src/features/clerk/types/types.ts diff --git a/README.md b/README.md index 857f798..1d29115 100644 --- a/README.md +++ b/README.md @@ -322,156 +322,3 @@ export default function RootScreen(): ReactElement { ); } ``` - -### Features - -#### 1. Clerk - -> **_NOTE:_** Required dependencies: `@clerk/clerk-expo`, `expo-web-browser`, `expo-auth-session` - -Hooks and helpers to create user authentication with [Clerk Expo SDK](https://clerk.com/docs/references/expo/overview). - -#### `useClerkResources` - -Hook, that provides access to essential Clerk methods and objects. - -Returned Object: - -- `signUp` - provides access to [SignUp](https://clerk.com/docs/references/javascript/sign-up) object. -- `signIn` - provides access to [SignIn](https://clerk.com/docs/references/javascript/sign-in) object. -- `setActive` - A function that sets the active session. -- `signOut` - A function that signs out the current user. - -#### `useAuthWithIdentifier` - -Hook, that provides functionality to handle user sign-up and sign-in processes using an identifier such as an email, phone number, or username. It supports both OTP (One Time Password) and password-based authentication methods. - -Parameters: - -- `method`: Specifies the type of identifier used for authentication (e.g., 'emailAddress', 'phoneNumber', 'username'). -- `verifyBy`: Specifies the verification method ('otp' for one-time passwords or 'password'). - -Returned Object: - -- `startSignUp`: Initiates a new user registration using the specified identifier and verification method. -- `startSignIn`: Initiates authentication of an existing user using the specified identifier and verification method. -- `startAuthorization`: Determines whether to initiate a sign-up or sign-in based on whether the user has been registered previously. -- `verifyCode`: Verifies an OTP code if the verification method is 'otp'. -- `isLoading`: Indicates whether an authentication request is in progress. -- `isVerifying`: Indicates whether an OTP verification is in progress. - -**Example:** - -```ts -import React, { useState } from 'react'; -import { View, TextInput, Button } from 'react-native'; -import { useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; - -export const AuthWithIdentifierComponent = () => { - const [identifier, setIdentifier] = useState(''); - const [verificationCode, setVerificationCode] = useState(''); - const { startSignUp, verifyCode, isLoading, isVerifying } = useAuthWithIdentifier('emailAddress', 'otp'); - - const handleSignUp = async () => { - await startSignUp({ identifier }); - }; - - const handleVerifyCode = async () => { - const result = await verifyCode({ code: verificationCode }); - console.log(result.sessionToken) - }; - - return ( - - - -