User GuideAuthentication
Authentication Configuration
TinyShip authentication system configuration guide
TinyShip has a complete authentication system built on Better Auth, supporting multiple authentication methods.
AI Quick Setup: Users with Agent Skills installed can tell their AI "help me configure auth" to use the tinyship-auth skill for interactive setup.
Related Pages
| Page | Path | Description |
|---|---|---|
| Sign In | /signin | User login entry |
| Sign Up | /signup | User registration entry |
| Phone Login | /cellphone | Phone verification login |
| WeChat Login | /wechat | WeChat scan login |
| Forgot Password | /forgot-password | Send password reset email |
| Reset Password | /reset-password | Set new password |
Authentication Tech Stack
- Auth Library: Better Auth
- Session Management: Token-based secure sessions
- Multi-factor Auth: Email verification, SMS verification
- Social Login: Google, GitHub, WeChat, etc.
- Security Features: CSRF protection, rate limiting, password hashing
Supported Authentication Methods
| Method | Description | Difficulty |
|---|---|---|
| Email/Password | Enabled by default, supports email verification and password reset | Easy |
| Google OAuth | Google account login | Medium |
| GitHub OAuth | GitHub account login | Medium |
| WeChat Login | Optional, China only (enterprise qualification) | Complex |
| SMS Login | Optional. Twilio for global numbers; Aliyun is China only | Complex |
Basic Configuration
BETTER_AUTH_SECRET="your-secret-key-here-32-characters-min"
# Local default. In production, set this to your public origin (for example https://gettinyship.dev).
BETTER_AUTH_URL="http://localhost:7001"
DATABASE_URL="postgresql://username:password@localhost:5432/tinyship"Detailed Configuration Documents
Choose the authentication methods you need:
Email/Password
Enabled by default, with email verification and password reset
Google OAuth
Integrate Google account login
GitHub OAuth
Integrate GitHub account login
WeChat Login
Integrate WeChat account login (China)
SMS Login
Phone verification code login
Frontend UI Configuration
Next.js Application
Edit apps/next-app/components/social-auth.tsx:
const defaultProviders: SocialProvider[] = ['google', 'github'];
// Optional China methods: 'wechat', 'phone'Nuxt.js Application
Edit apps/nuxt-app/components/SocialAuth.vue:
const props = withDefaults(defineProps<Props>(), {
className: '',
providers: () => ['google', 'github']
// Optional China methods: 'wechat', 'phone'
})TanStack Start Application
Edit apps/tanstack-app/src/components/social-auth.tsx to control displayed OAuth buttons:
const defaultProviders: SocialProvider[] = ['google', 'github'];
// Optional China methods: 'wechat', 'phone'