User Management & OAuth
PocketStarter provides comprehensive user authentication with email/password and OAuth support, powered by PocketBase. You can define what routes are protected for signed in users.
Authentication methods
Email & Password
PocketStarter supports traditional email and password authentication.
By default, passwords require 8+ characters with at least one letter and one number. Email verification is sent and required before login, and password reset functionality is available too.
OAuth Providers
OAuth allows users to sign in using their existing accounts from popular services like Google, GitHub, or Facebook. This is often more convenient than creating a new password and can increase sign-up rates.
PocketStarter supports many popular OAuth methods. In our experience, offering at least Google sign-in can significantly increase sign-up conversion. Google OAuth is therefore enabled by default.
For more information on how to set up Google OAuth, see the Google OAuth documentation.
Adding new providers
Adding new providers is a straightforward process.
- PocketBase Admin: Go to Settings → Auth providers → Add provider, and configure the settings
- Frontend Config:
- Open
src/lib/auth/pocketbase.ts
- Add a new Icon Component with the logo
- Add the new provider to the
enabledProviders
array
- Open
// Example for GitHub OAuth
const GitHubIcon = ({ className }: { className?: string }) => (
<svg className={className} viewBox="0 0 24 24">
...
</svg>
)
// Add to your oauth providers array
export const oauthProviders = {
github: {
name: 'github',
provider: 'github',
displayName: 'Continue with GitHub',
icon: GitHubIcon,
bgColor: 'bg-gray-800',
textColor: 'text-white'
}
}
export const enabledProviders = ['google', 'github']