Stack Auth
WelcomeGuides
SDKComponentsAPI Reference
OverviewFAQ
Getting Started
SetupComponentsUsersProductionVite JavaScript Example
Apps
API KeysEmailsOAuthOrgs and TeamsRBAC PermissionsWebhooksPayments
Concepts
Backend IntegrationCustom User DataJWT Tokens
OAuth Providers
Stack AppTeam SelectionUser Onboarding
Customization
Custom PagesCustom StylesDark ModeInternationalization
Page Examples
Other
CLI AuthenticationSelf-hostSupabaseConvexMCP Setup
Stack Auth Docs

Vite JavaScript Example

This guide demonstrates how to integrate Stack Auth with Vite. The same principles apply to other JavaScript frameworks as well. You can find the complete example code in our GitHub repository.

Initialize the app

stack/client.ts

Index page with user information

index.html

Sign in with password

password-sign-in.html

Sign up with password

password-sign-up.html

Sign in with OTP/Magic Link

otp-sign-in.html

OAuth sign in

oauth.html
Previous PageProduction
Next PageAPI Keys

On this page

Initialize the appIndex page with user informationSign in with passwordSign up with passwordSign in with OTP/Magic LinkOAuth sign in

Stack Auth AI

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.