https://github.com/workos/react-authkit-example
Example of @workos-inc/authkit-react
https://github.com/workos/react-authkit-example
Last synced: about 1 year ago
JSON representation
Example of @workos-inc/authkit-react
- Host: GitHub
- URL: https://github.com/workos/react-authkit-example
- Owner: workos
- License: mit
- Created: 2024-07-25T21:45:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T18:31:31.000Z (about 1 year ago)
- Last Synced: 2025-04-11T15:12:20.061Z (about 1 year ago)
- Language: TypeScript
- Size: 228 KB
- Stars: 8
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# authkit-react example
An example application demonstrating how to authenticate users with AuthKit's React SDK.
## Prerequisites
You will need a [WorkOS account](https://dashboard.workos.com/signup).
## Running the example
1. In the [WorkOS dashboard](https://dashboard.workos.com), head to the Redirects tab and create a [sign-in callback redirect](https://workos.com/docs/user-management/1-configure-your-project/configure-a-redirect-uri) for `http://localhost:5173`.
3. Navigate to the "Authentication" page and click the "Configure CORS" button. Add `http://localhost:5173` to the list of origins to allow clients sessions from. Click "Save."
4. Navigate to the API keys tab and copy the _Client ID_. Rename the `.env.local.example` file to `.env.local` and supply your Client ID.
7. Run the following command and navigate to [http://localhost:5173](http://localhost:5173).
```bash
npm run dev
```