[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fauthhero%2Fauthhero&env=VITE_AUTH0_DOMAIN,VITE_AUTH0_CLIENT_ID,VITE_AUTH0_API_URL,VITE_SINGLE_DOMAIN_MODE&envDescription=Configure%20
npm install @authhero/react-admin

> Cloudflare Pages Setup: Select "Pages" during setup, set root directory to apps/react-admin, build command to pnpm run build, and output directory to dist. Add environment variables VITE_AUTH0_DOMAIN, VITE_AUTH0_CLIENT_ID, VITE_AUTH0_API_URL, and VITE_SINGLE_DOMAIN_MODE.
Install the application dependencies by running:
``sh`
npm installor
yarn install
You can configure the default domain connection using environment variables. Create a .env file in the apps/react-admin directory:
`bashProduction
VITE_AUTH0_DOMAIN=login.sesamy.com
VITE_AUTH0_CLIENT_ID=auth-admin
VITE_AUTH0_API_URL=https://auth2.sesamy.com
See
.env.example for more details.Notes:
- If
VITE_AUTH0_DOMAIN is set, it will be automatically added to the domain list
- Users can still add additional domains through the UI (unless VITE_SINGLE_DOMAIN_MODE=true)
- Set VITE_SINGLE_DOMAIN_MODE=true to skip the domain selector entirelyDevelopment
Start the application in development mode by running:
`sh
npm run dev
or
yarn dev
`Production
Build the application in production mode by running:
`sh
npm run build
or
yarn build
`Deployment
The React Admin application can be deployed to Vercel. See the Vercel deployment guide for detailed instructions.
Important: When deploying to Vercel, you must set the environment variable
ENABLE_EXPERIMENTAL_COREPACK=1 to avoid build errors with pnpm.DataProvider
The included data provider use FakeREST to simulate a backend.
You'll find a
data.json file in the src directory that includes some fake data for testing purposes.It includes two resources, posts and comments.
Posts have the following properties:
id, title and content.
Comments have the following properties: id, post_id and content.Tests
You can run the included tests with the following command:
`sh
npm run test
or
yarn run test
``