Lit Explorer Naga is an application that allows you to authenticate with Lit Protocol using the native Lit auth methods.
# Global Settings
VITE_LOGIN_SERVICE_URL=https://login.litgateway.com
VITE_LOGIN_DISCORD_CLIENT_ID=1052874239658692668
# Network-Specific Auth Service URLs
VITE_AUTH_SERVICE_URL_NAGA_DEV=https://naga-dev-auth-service.getlit.dev
VITE_AUTH_SERVICE_URL_NAGA_TEST=https://naga-test-auth-service.getlit.dev
VITE_AUTH_SERVICE_URL_NAGA=https://naga-auth-service.getlit.devbun install && bun dev
- Add a new file in
src/lit-action-examples/entries/that default-exports aLitActionExample. Theidmust be unique. - Use
String.rawto define multiline snippets, e.g.const code = String.raw\`...\`;and fill intitle, optionaldescription,order, and any defaultjsParams. - The registry auto-loads every file in that directory, so your example will appear in the Lit Action editor once you save and refresh the app.
- Prefer small, focused samples that demonstrate a single concept; link to docs inside the description if extra context is needed.
- You are considered "logged-in" when both a PKP and an auth context exist in state.
After authenticating with a method (Google, Discord, WebAuthn, EOA, Stytch, Custom), either:
- You select an existing PKP in the PKP selection section
- You mint a new PKP and immediately create
authContext, then setuser
The <LitAuthProvider /> does not redirect on successful login. It simply closes the modal once user is set and isAuthenticated becomes true.
The dashboard is always the index route for /, and it conditionally renders based on auth state from context. When the user logs in, React re-renders the same component with different UI.
Inside LoggedInDashboard, it reads user from useLitAuth(). If there’s no user, it shows a sign-in experience and, in popup mode, auto-opens the modal.