Login Component

Our login component provides a simple means to incorporate secure user authentication into Mobile apps. Easily tailor the login UI to fit your project's needs with various customization options.

Components Visuals

To unlock early access to the component Get Access

Installation

To install the Quest react-native-sdk into your project, follow these steps:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

npm install @questlabs/react-native-sdk

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.


Props of Login Component

The QuestLogin component accepts the following props

PropNameTypeRequiredDetails

googleClientId

string

optional

The Google Client ID for OAuth 2.0 authentication.

redirectUri

string

optional

The URI where users will be redirected after authentication. Ensure that this URL matches the one configured in your OAuth provider (Google Console).

redirectURL

string

optional

The URL where users will be redirected after authentication.

mainViewStyle

ViewStyle

optional

Main View Styling

headerTextStyle

TextStyle

optional

Header Text Styling for Welcome Back

headerTextStyle2

TextStyle

optional

Header Text Styling for Please Enter Delails Text

ContinueBtnViewStyle

ViewStyle

optional

Continue Buton ViewStyle

ContinueBtnTextStyle

TextStyle

optional

Continue Button TextStyle

GoogleViewStyle

ViewStyle

optional

Google Button ViewStyle

GoogleTextStyle

TextStyle

optional

Google Button TextStyle

headerTextStyle3

TextStyle

optional

Header Text Styling for Please Enter Otp Text

OtpTextStyle

TextStyle

optional

Otp Label TextStyle

OtpContViewStyle

ViewStyle

optional

Otp Input ViewStyle

OtpInputTextStyle

TextStyle

optional

Single OtpInput TextStyle

VerifyBtnViewStyle

ViewStyle

optional

Verify Button ViewStyle

VerifyBtnTextStyle

TextStyle

optional

Verify Button TextStyle


Usage

To integrate the Feedback component into your React application, follow these steps

  • Import the Feedback Component: Import the Feedbackcomponent from the @questlabs/react-native-sdk package.

  • Import the QuestProvider Component: Import the QuestProvider component from the @questlabs/react-native-sdk package.

import { QuestProvider, Login} from '@questlabs/react-native-sdk'

<QuestProvider
  apiKey="your-api-key"
  apiSecret="your-api-secret"
  entityId="your-entity-id"
>
  <Login
    googleClientId="your-google-client-id"
    redirectUri="your-redirect-uri"
    redirectURL="your-redirect-url"
  />
</QuestProvider>

Replace "your-api-key", "your-api-secret", and "your-entity-id" with your actual Quest API credentials

Replace "your-google-client-id", "your-redirect-uri", and "your-redirect-url" with your actual configuration details.

Example Usage

Here's an example of how to use theLogin component within your React application

import { Button, Text, SafeAreaView, StyleSheet } from "react-native";
import { Login } from "@questlabs/react-native-sdk";
export default function App() {
  return (
    <SafeAreaView style={styles.container}>
    
     <QuestProvider
        apiKey="Your-Api-Key"
        apiSecret="Your-Api-Secret"
        entityId="Your-Api-entityId"
        > 
        
        <Login 
           googleClientId= {'your-google-client-id'}
           redirectUri = {'your-redirect-uri'}
           redirectURL = {'your-redirect-url' }
           mainViewStyle = {{ backgroundColor: 'grey' ,borderRadius: 10}}
           headerTextStyle = {{ color: 'white' fontSize: 20 }}
           ContinueBtnViewStyle = {{ width : 200}}
           ContinueBtnTextStyle = {{  fontSize: 20}}
           //Props
        />
     </QuestProvider>
    
    </SafeAreaView>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "white",
    marginTop: 40,
    padding: 20,
    justifyContent: "center",
    alignItems: "center",
  },
});

The above example uses all the props.

Last updated