Skip to main content

React single-page app

A Vite and React app with sign-in through the hosted page and a callback route.

StarterPlanned
This example is planned. Not built yet. This page is the specification for the example.
Works with
JavaScript / TypeScriptReact

What you get​

  • The provider around the app.
  • A header that changes with the session.
  • A callback route.
  • A protected route.

Create it​

npm create vite@latest my-app -- --template react-ts
cd my-app
npm install @lumoauth/react

Then add the files below.

Settings​

VariableValue
VITE_LUMOAUTH_DOMAINhttps://app.lumoauth.dev
VITE_LUMOAUTH_ORG_IDYour organization.
VITE_LUMOAUTH_CLIENT_IDThe client ID of a public application.

Files​

FileWhat it does
src/main.tsxLumoAuthProvider
src/pages/AuthCallback.tsxAuthCallback
src/components/Header.tsxSignedIn, SignedOut, UserButton, SignInButton

Next steps​