@authhero/react-admin
v0.50.0
Published
[](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
Downloads
1,345
Readme
react-admin
Cloudflare Pages Setup: Select "Pages" during setup, set root directory to
apps/react-admin, build command topnpm run build, and output directory todist. Add environment variablesVITE_AUTH0_DOMAIN,VITE_AUTH0_CLIENT_ID,VITE_AUTH0_API_URL, andVITE_SINGLE_DOMAIN_MODE.
Installation
Install the application dependencies by running:
npm install
# or
yarn installConfiguration
Environment Variables
You can configure the default domain connection using environment variables. Create a .env file in the apps/react-admin directory:
# Production
VITE_AUTH0_DOMAIN=login.sesamy.com
VITE_AUTH0_CLIENT_ID=auth-admin
VITE_AUTH0_API_URL=https://auth2.sesamy.com
# Or for local development
VITE_AUTH0_DOMAIN=localhost:3000
VITE_AUTH0_CLIENT_ID=auth-admin
VITE_AUTH0_API_URL=https://localhost:3000
# Optional: Skip domain selector and use configured domain directly
VITE_SINGLE_DOMAIN_MODE=trueSee .env.example for more details.
Notes:
- If
VITE_AUTH0_DOMAINis 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=trueto skip the domain selector entirely
Development
Start the application in development mode by running:
npm run dev
# or
yarn devProduction
Build the application in production mode by running:
npm run build
# or
yarn buildDeployment
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:
npm run test
# or
yarn run test