> For the complete documentation index, see [llms.txt](https://docs.secuuth.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.secuuth.io/integration/react-native.md).

# React Native

**Requirements**

```
npm i react-native-webview expo-secure-store
```

**Step 1: Add Secqure SDK**

{% tabs %}
{% tab title="npm" %}
npm i secqure-react-native-sdk
{% endtab %}
{% endtabs %}

**Step 2: Import Secqure SDK in your project**

```
import {Secqure_Webview} from "secqure-react-native-sdk"
```

Step 3: Configure Navigation

```
<NavigationContainer>
        <Stack.Screen name="Secqure_Webview" component={Secqure_Webview} />
</NavigationContainer>
```

Step 4: Route invocation and Callback

```
navigation.navigate("Secqure_Webview", {
                apiKey: "XXXXXXXXXXXXXXXX",
                secretKey: "XXXXXXXXXXXX",
                callback: (payload) => {},
                });
```

Above steps render a login form like below

![](/files/ADXathFc09H6tQ3qaUfN)

Secqure returns User details and tokens upon first authentication and only tokens in subsequent authentications. You can use User identity information as required. Your backend server should validate the access & Id tokens and extract information. Use SDKs to validate tokens

```
{
	"tokens": {
		"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiO...",
		"idToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIz...",
		"refreshToken": "f76d722afc0ec69e5aa11838a03569a524f3a2448932"
	},
	"user": {
		"pubKey": "i50MtIDpmQaFqozPYR6u3diOft0X6X75",
		"userId": "XXXXXX",
		"systemId": "3526b57c-f017-4659-bbb4-b1442046e46e",
		"createTime": "2022-01-17T07:21:34.356Z",
		"updateTime": "2022-01-17T07:21:49.000Z",
		"deviceType": "Win32",
		"deviceName": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
	}
}
```

```
{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiO...",
"idToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIz...",
"refreshToken": "f76d722afc0ec69e5aa11838a03569a524f3a2448932"
}
```

**Congratulations... You are done!!!**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.secuuth.io/integration/react-native.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
