### Install Dependencies (npm) Source: https://github.com/ronasit/react-native-common-modules/blob/main/CONTRIBUTING.md Installs project dependencies using npm. This is a prerequisite for starting development. ```bash npm install ``` -------------------------------- ### Setup Reactotron Debugger with Redux Integration (TypeScript) Source: https://context7.com/ronasit/react-native-common-modules/llms.txt Configures and initializes the Reactotron debugger with Redux integration for development. It supports custom plugins like MMKV storage inspector and networking plugins, and only activates in development mode. This setup requires @reduxjs/toolkit and reactotron-react-native. ```typescript import { setupReactotron } from '@ronas-it/react-native-common-modules/reactotron'; import { configureStore, Reducer } from '@reduxjs/toolkit'; import type { ReactotronReactNative } from 'reactotron-react-native'; import mmkvPlugin from 'reactotron-react-native-mmkv'; import { storage } from './mmkv-storage'; import { rootReducer, AppState } from './root-reducer'; // Setup with custom plugins const reactotron = setupReactotron('MyApp', [ // Add MMKV storage inspector (reactotron) => mmkvPlugin({ storage }), // Add custom networking plugin (reactotron) => reactotron.use(networkingPlugin()), ]); // Create Redux store with Reactotron enhancer const enhancers = reactotron ? [reactotron.createEnhancer()] : []; export const store = configureStore({ reducer: rootReducer, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false, }), enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(enhancers), }); // Basic setup without plugins const simpleReactotron = setupReactotron('SimpleApp'); const simpleEnhancers = simpleReactotron ? [simpleReactotron.createEnhancer()] : []; export const simpleStore = configureStore({ reducer: rootSimpleReducer, // Assuming rootSimpleReducer is defined elsewhere enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(simpleEnhancers), }); ``` -------------------------------- ### Email and OTP Authentication with useAuthWithIdentifier Source: https://context7.com/ronasit/react-native-common-modules/llms.txt Handles email-based authentication using one-time passwords (OTP). It supports starting authorization, verifying the OTP code, and managing loading states. Dependencies include React Native components and SecureStore for token management. ```typescript import { useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; import { useState } from 'react'; import { View, TextInput, Button, Alert, ActivityIndicator } from 'react-native'; // Email + OTP authentication function EmailOtpAuth() { const [email, setEmail] = useState(''); const [code, setCode] = useState(''); const [step, setStep] = useState<'email' | 'verify'>('email'); const { startSignUp, startSignIn, startAuthorization, verifyCode, isLoading, isVerifying } = useAuthWithIdentifier('emailAddress', 'otp'); const handleSubmitEmail = async () => { // Automatically determines sign-up vs sign-in const result = await startAuthorization({ identifier: email }); if (result.error) { Alert.alert('Error', 'Failed to send verification code'); return; } if (result.isSuccess) { setStep('verify'); } }; const handleVerifyCode = async () => { const result = await verifyCode({ code, tokenTemplate: 'my-jwt-template' // optional }); if (result?.sessionToken) { // Store token and navigate await SecureStore.setItemAsync('token', result.sessionToken); navigation.replace('Home'); } else { Alert.alert('Error', 'Invalid verification code'); } }; if (step === 'email') { return (