> For the complete documentation index, see [llms.txt](https://docs.questera.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.questera.ai/questera-ai-sdks/react-native-sdk-components/expansion/share-with-friends.md).

# Share With friends

## Components Visuals&#x20;

{% tabs %}
{% tab title="Overview" %}

<figure><img src="/files/q5ptDpHNFxOb85UItN1f" alt="" width="563"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
To unlock early access to the component                                                           [**Get Access**](https://bijfwfnqtsj.typeform.com/to/eUXDpbuh)
{% endhint %}

## 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:

```jsx
npm install @questlabs/react-native-sdk
```

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

{% hint style="info" %}
Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.
{% endhint %}

## Usage

### Root Component

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

```jsx
import { QuestProvider } from '@questlabs/react-sdk';
```

* **Pass the Required Props**:  Pass the required props to the `QuestProvider`. The required props are `apiKey`,  `entityId,` `authenticationToken` and `fontFamily.`

{% hint style="info" %}
To load external fonts, please refer this doc to setup [expo-font](https://docs.expo.dev/versions/latest/sdk/font/) on your expo app.
{% endhint %}

### Component Usage

To integrate the `useShareWithFriend` component into your React native application, follow these steps.

* **Import useShareWithFriend Hook:** Import the `useShareWithFriend` component from the `@questlabs/react-sdk` package.
* **Import the ShareWithFriend Component**: Import the **ShareWithFriend** component from the `@questlabs/react-sdk` package.
* **Pass the Required Props**:  Pass the required props to the `useShareWithFriend` .  The required props are `questId`, `questUserId`, and `questToken` or if user don't have quest User id then they  can pass own userId to get questUserId and Token.&#x20;

```typescript
import { useShareWithFriend , ShareWithFriend } from "@questlabs/react-native-sdk";
```

{% hint style="info" %}
Don't not use QuestProvider and useShareWithFriend Hook in same file
{% endhint %}

## Props of ShareWithFriend Component

The ShareWithFriend component accepts the following props

<table><thead><tr><th width="212">Props Name</th><th width="120">Type</th><th width="103">Require </th><th>Details</th></tr></thead><tbody><tr><td>header</td><td>string</td><td>Optional</td><td>Component Header Text.</td></tr><tr><td>headerDescrption</td><td>string</td><td>Optional</td><td>Component Header Description Text.</td></tr><tr><td>referralLink</td><td>string</td><td>Require</td><td>referral link text</td></tr><tr><td>title</td><td>string</td><td>Optional</td><td>Title Text main view</td></tr><tr><td>description</td><td>string</td><td>Optional</td><td>Description Text Main View.</td></tr><tr><td>buttonText</td><td>string</td><td>Optional</td><td>Send Button Text.</td></tr></tbody></table>

### Style Prop

<table><thead><tr><th width="215">Props Name</th><th width="126">Type</th><th width="104">Require</th><th>Details</th></tr></thead><tbody><tr><td>mainViewStyle</td><td>ViewStyle</td><td>optional</td><td>Main View style</td></tr><tr><td>headerTextStyle</td><td>TextStyle</td><td>optional</td><td>Header Text style </td></tr><tr><td>descriptionTextStyle</td><td>TextStyle</td><td>optional</td><td>description text style</td></tr><tr><td>codeViewStyle</td><td>ViewStyle</td><td>optional</td><td>Input box view style</td></tr><tr><td>codeTextStyle</td><td>TextStyle</td><td>optional</td><td>input box text style </td></tr><tr><td>inviteButtonViewStyle</td><td>ViewStyle</td><td>optional</td><td>button view style</td></tr><tr><td>buttonTextStyle</td><td>TextStyle</td><td>optional</td><td>button text style</td></tr><tr><td>headingText</td><td>TextStyle</td><td>optional</td><td>Outter heading text style</td></tr><tr><td>detailText</td><td>TextStyle</td><td>optional</td><td>outter detail text style</td></tr><tr><td>middalView</td><td>ViewStyle</td><td>optional</td><td>MIddal view style</td></tr></tbody></table>

## Example Usage

App.js

```typescript
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"  
         fontFamily= "Your-Font-FamFamily"
        >
        
        <DemoComponent />
        
        </QuestProvider>
   
    </SafeAreaView>
  );
}
```

DemoComponent.tsx

```typescript
import React from "react";
import { ShareWithFriend, useShareWithFriend } from "@questlabs/react-native-sdk";
const DemoComponent = () => {
  // const shareWithFriend = useShareWithFriend ({
  //   questId: "Your-Quest_ID" ,
  //   userId:"5235trfet365try67ywry5"
  //   })

  const shareWithFriend = useShareWithFriend ({
    questId: "Your-Quest_ID" ,
    questUserId: "Your-user-id",
    questToken: "Your-Token-id" 
    });
  return (
     <>
      <ShareWithFriend
        // referralLink="eaigfnikadhn"
        referralLink={shareWithFriend.referralLink}
        loading={shareWithFriend.loading}
        buttonText="atgdasg"
        description="knvakneihjtg"
        header="ksnmdgsdfg"
        headerDescrption="smdgbmsdfngb"
        title="alkdngnadopjng"
      />
    </>
  );
};
export default DemoComponent;
```

## Demo

{% embed url="<https://www.loom.com/share/cafba868c0794d33b6ca8b43bbe34f68?sid=96421737-8523-4956-a311-4cb99799faeb>" %}
