## React embedded login quickstart
This guide walks you through integrating Frontegg’s login box into your React app, with built-in support for Sign In, Sign Up, SSO, and automatic redirects—all in just a few lines of code.
br
Check out the sample package on GitHub
br
Getting your Frontegg subdomain and `clientId`
Frontegg creates a unique subdomain and client id for every environment created on the account. In order to retrieve the clientId `subdomain` that will act as the `baseUrl` in the integration, navigate to your workspace `Keys & domains` menu, and copy the Frontegg domain and `clientId`.
### Step 1: Create a Vite.js app with React
If you have an existing app, skip this step.
br
To create a new app, use the following script.
br
```
npm create vite@latest app-with-frontegg --template react
```
br
Run the following command to install the Frontegg React.JS library.
```
npm install @frontegg/react react-router-dom
```
```
yarn add @frontegg/react react-router-dom@5.3.0
```
br
### Step 2: Configure
Wrap your root component with `FronteggProvider`.
See [`contextOptions`](/ciam/sdks/components/fronteggappoptions#contextoptions) for more information.
```typescript
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import { FronteggProvider } from '@frontegg/react';
const contextOptions = {
baseUrl: 'https://[YOUR-SUBDOMAIN].frontegg.com',
appId: '[YOUR-APP-ID]'
};
const authOptions = {
keepSessionAlive: true // Keeps the session alive by refreshing the JWT in the background
};
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(