Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
635 changes: 0 additions & 635 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Empty file added docs/.nojekyll
Empty file.
35 changes: 35 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Frontegg React Native SDK
![Frontegg_React Native_SDK](/images/frontegg-react-native.png)

Welcome to the official **Frontegg React Native SDK** — your all-in-one solution for
integrating authentication and user management into your React Native mobile
app. [Frontegg](https://frontegg.com/) is a self-served user management platform, built for modern
SaaS applications. Easily implement authentication, SSO, RBAC, multi-tenancy, and more — all from a
single SDK.

## 📚 Documentation

This repository includes:

- A [Get Started](/docs/getting-started.md) guide for quick integration
- A [Setup Guide](/docs/setup.md) with detailed setup instructions
- [Usage Examples](/docs/usage.md) with common implementation patterns
- [Advanced Topics](/docs/advanced.md) for complex integration scenarReact Native
- A [Embedded](/example) example projects to help you get started quickly

For full documentation, visit the Frontegg Developer Portal:
🔗 [https://developers.frontegg.com](https://developers.frontegg.com)

---

## 🧑‍💻 Getting Started with Frontegg

Don't have a Frontegg account yet?
Sign up here → [https://portal.us.frontegg.com/signup](https://portal.us.frontegg.com/signup)

---

## 💬 Support

Need help? Our team is here for you:
[https://support.frontegg.com/frontegg/directories](https://support.frontegg.com/frontegg/directories)
5 changes: 5 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [React Native SDK](README.md)
- [Getting Started](getting-started.md)
- [Setup Guide](setup.md)
- [Usage Examples](usage.md)
- [Advanced Topics](advanced.md)
134 changes: 134 additions & 0 deletions docs/advanced.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Advanced options

In this guide, you'll find an overview and best practices for enabling advanced features like passkeys and multi-app configurations.

### Multi-app support

#### iOS setup

If your Frontegg workspace supports multiple apps, you need to specify which one your iOS client should use.

To enable this feature, add `applicationId` to `Frontegg.plist` as follows:

```xml
<plist version="1.0">
<dict>
<key>applicationId</key>
<string>{{FRONTEGG_APPLICATION_ID}}</string>

<key>baseUrl</key>
<string>{{FRONTEGG_BASE_URL}}</string>

<key>clientId</key>
<string>{{FRONTEGG_CLIENT_ID}}</string>
</dict>
</plist>
```

- Replace `{{FRONTEGG_APPLICATION_ID}}` with your application ID.
- Replace `{{FRONTEGG_BASE_URL}}` with the domain name from your Frontegg Portal.
- Replace `{{FRONTEGG_CLIENT_ID}}` with your Frontegg client ID.

#### Android setup

1. Open the `android/app/build.gradle` file in your project.
2. Add the following variable at the top of the file (outside the android block):

```groovy
def fronteggApplicationId = "{{FRONTEGG_APPLICATION_ID}}"
```

3. Inside the `android { defaultConfig { } }` block, add the following line:

```groovy
buildConfigField "String", "FRONTEGG_APPLICATION_ID", "\"$fronteggApplicationId\""
```


### Passkeys authentication

Passkeys provide a seamless, passwordless login experience using WebAuthn and platform-level biometric authentication.

**Prerequisites**

1. **iOS Version**: Ensure your project targets iOS 15 or later to support the necessary WebAuthn APIs.
2. **Android**: Use Android SDK 26+.
3. **Frontegg SDK Version**: Use Frontegg iOS SDK version 1.2.24 or later.

#### Android setup

1. Open `android/build.gradle`.
2. Add the following Gradle dependencies under dependencies:

```groovy
dependencies {
implementation 'androidx.browser:browser:1.8.0'
implementation 'com.frontegg.sdk:android:1.2.30'
}
```

3. Inside the `android` block, add the following to set Java 8 compatibility:

```groovy
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
```

#### iOS setup

1. Open your project in **Xcode**
2. Go to your **target** settings
3. Open the **Signing & Capabilities** tab
4. Click the **+ Capability** button and add **Associated Domains**
5. Under **Associated Domains**, click the **+** and add: `webcredentials:your-domain.com`. For example, if your domain is `https://example.com`, use `webcredentials:example.com`.
5. Enter your domain in the format: `webcredentials:[YOUR_DOMAIN]`. For example: `webcredentials:example.com`.
6. Host a `.well-known/webauthn` JSON file on your domain server with the following structure:
```json
{
"origins": [
"https://example.com",
"https://subdomain.example.com"
]
}
```
7. Ensure the file is publicly accessible at: `https://example.com/.well-known/webauthn`.
8. Verify that your Associated Domains configuration works using [Apple’s Associated Domains Validator](https://developer.apple.com/contact/request/associated-domains).


#### Register Passkeys

Use the registerPasskeys method to register a passkey for the current user:

```tsx
import { registerPasskeys } from '@frontegg/react-native';

async function handleRegisterPasskeys() {
try {
await registerPasskeys();
console.log('Passkeys registered successfully');
} catch (error) {
console.error('Error registering passkeys:', error);
}
}
```

#### Login with Passkeys

Use the loginWithPasskeys method to log in using passkeys:

```tsx
import { loginWithPasskeys } from '@frontegg/react-native';

async function handleLoginWithPasskeys() {
try {
await loginWithPasskeys();
console.log('Passkeys login successful');
} catch (error) {
console.error('Error logging in with Passkeys:', error);
}
}
```
70 changes: 70 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting started with Frontegg React Native SDK

Welcome to the Frontegg React Native SDK! Easily integrate Frontegg’s out-of-the-box authentication and user management functionalities into your applications for a seamless and secure user experience.

The Frontegg React Native SDK can be used in two ways:

1. With the hosted Frontegg login that will be called through a webview, enabling all login methods supported on the login box
2. By directly using Frontegg APIs from your custom UI, with available methods

The Frontegg React Native SDK automatically handles token refresh behind the scenes, ensuring your users maintain authenticated sessions without manual intervention.

### Supported languages
- JavaScript / TypeScript: For React Native app development and using Frontegg hooks and components
- Kotlin (Android): For native configuration and initialization
- Groovy: For Android build.gradle setup (Groovy DSL)
- Swift: For iOS configuration and SDK linking
- Objective-C: Required for older iOS projects or mixed-language setups (e.g., AppDelegate integration).

### Supported platforms
- iOS: Deployment target 14.0 or higher
- Android: Minimum SDK version 26 (Android 8.0)
- React Native: Version 0.63+ (recommended for best compatibility)
- WebAuthn support (Passkeys):
- iOS: Version 15+ required for platform-level support
- Android: SDK 26+, with browser support for Chrome custom tabs

### Prepare your Frontegg environment

- Navigate to Frontegg Portal [ENVIRONMENT] → `Keys & domains`
- If you don't have an application, follow the integration steps after signing up
- Copy your environment's `FronteggDomain` from Frontegg Portal domain for future steps
- Navigate to [ENVIRONMENT] → Authentication → Login method
- Make sure hosted login is toggled on.
- Add the following common redirect URL:

```
{{FRONTEGG_BASE_URL}}/oauth/authorize
```

- Replace `{{IOS_BUNDLE_IDENTIFIER}}` with your IOS bundle identifier.
- Replace `{{ANDROID_PACKAGE_NAME}}` with your Android package name.
- Replace `{{FRONTEGG_BASE_URL}}` with your Frontegg domain, i.e `app-xxxx.frontegg.com` or your custom domain.

- For iOS add:
```
{{IOS_BUNDLE_IDENTIFIER}}://{{FRONTEGG_BASE_URL}}/ios/oauth/callback
```

- For Android add:
```
{{ANDROID_PACKAGE_NAME}}://{{FRONTEGG_BASE_URL}}/android/oauth/callback
https://{{FRONTEGG_BASE_URL}}/oauth/account/redirect/android/{{ANDROID_PACKAGE_NAME}} ← required for assetlinks
```

> [!WARNING]
> On every step, if you have a [custom domain](https://developers.frontegg.com/guides/env-settings/custom-domain), replace the `[frontegg-domain]` and `[your-custom-domain]` placeholders with your custom domain instead of the value from the Keys & domains page.

### Add Frontegg package to the project

Use your preferred package manager to install the Frontegg React Native SDK:

npm:
```
npm install -s @frontegg/react-native
```

yarn:
```
yarn add @frontegg/react-native
```
Binary file added docs/images/frontegg-react-native.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Frontegg React Native SDK Documentation</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Frontegg React Native SDK Documentation">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
<style>
:root {
--theme-color: #7396fb;
}
.markdown-section a {
color: #7396fb;
}
</style>
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Frontegg React Native SDK',
repo: '',
loadSidebar: true,
subMaxLevel: 3,
auto2top: true,
alias: {
'/docs/(.*)': '/$1',
'/README.md': '/docs/README.md'
},
search: {
maxAge: 86400000,
paths: 'auto',
placeholder: 'Search',
noData: 'No Results!',
depth: 6
}
}
</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-kotlin.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-java.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
</body>
</html>
Loading
Loading