Cross-Selling

Boost revenue and enhance user satisfaction with our automated upselling. Tailored suggestions for additional services or products are seamlessly offered based on individual product usage, optimizing

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.

Usage

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

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

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

import { QuestProvider,CrossSelling } from '@questlabs/react-sdk';
  • Pass the Required Props: Pass the required props to the QuestProvider. The required props are apiKey, apiSecret, and entityId. and required props for the CrossSelling component is discount .

Props of CrossSelling Component

The CrossSelling component accepts the following props

Style Prop

styleConfig {
  BackgroundWrapper?: ViewStyle;
  Description?: TextStyle;
  Footer?: {
    FooterStyle?: ViewStyle;
    FooterText?: TextStyle;
    FooterIcon?: TextStyle;
  };
  Form?: ViewStyle;
  Heading?: TextStyle;
  PrimaryButton?: ViewStyle;
  SecondaryButton?: ViewStyle;
  Timer?: {
    backgroundColor?: string;
    primaryColor?: string;
    secondaryColor?: string;
  };
}

Example Usage

App.js

import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
import React, { useState } from "react";
import { QuestProvider } from "@questlabs/react-native-sdk";
import DemoComponent from "./DemoComponent";

export default function App() {
return (
    <SafeAreaView style={styles.container}>
      <StatusBar />
      <QuestProvider
        apiKey="Your-Api-Key"
        apiSecret="Your-Api-Secret"
        entityId="Your-Api-entityId"
        authenticationToken="Your-authentication-token"  >
        
        <DemoComponent />
        
        </QuestProvider>
   
    </SafeAreaView>
  );
}

DemoComponent.tsx

import React from "react";
import { CrossSelling, useCrossSelling} from "@questlabs/react-native-sdk";
const DemoComponent = () => {
  //const crossSelling = useCrossSelling({
  //   questId: "Your-Quest_ID" ,
  //   userId:"5235trfet365try67ywry5"
  //   })

  const crossSelling = useCrossSelling({
    questId: "Your-Quest_ID" ,
    questUserId: "Your-user-id",
    questToken: "Your-Token-id" 
    });
  return (
    <>
     <CrossSelling
        claimRewardHandler={(email) => console.log(email)}
        heading={"50% off on limited products"}
        description={"bla bla blka bal"}
        primaryDescription={"hello thasfgaib"}
        primaryHeading={"mast cize hai"}
        expiryDate={"2024-07-17"}
        // expiryDate={expiryDate} 
        isEmail={true}
        showFooter={true}
        styleConfig={{
          BackgroundWrapper: { backgroundColor: "red" },
          Description: { color: "yellow" },
          Footer: {
            FooterIcon: { color: "red" },
            FooterStyle: { backgroundColor: "orange" },
            FooterText: { color: "red" }
          },
          Form: {
            backgroundColor: "gray"
          },
          Heading: { color: "blue" },
          PrimaryButton: { backgroundColor: "red" },
          SecondaryButton: { backgroundColor: "yellow" },
          Timer: {
            backgroundColor: "white",
            primaryColor: "red",
            secondaryColor: "blue"
          }
        }}

      />
    </>
  );
};
export default DemoComponent;

Demo

Last updated