TinyShip
TinyShip
 TinyShip
TinyShip
TinyShip Documentation
TinyShip User GuideGetting StartedBasic Configuration
Authentication ConfigurationEmail Password AuthenticationGoogle OAuth ConfigurationGitHub OAuth ConfigurationWeChat Login ConfigurationSMS Verification Login
Credits System ConfigurationAffiliate System Configuration
Storage Service ConfigurationDatabase ConfigurationCaptcha Configuration
Development Best PracticesLocal E2E Workflow
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

PagePathDescription
Sign In/signinUser login entry
Sign Up/signupUser registration entry
Phone Login/cellphonePhone verification login
WeChat Login/wechatWeChat scan login
Forgot Password/forgot-passwordSend password reset email
Reset Password/reset-passwordSet 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

MethodDescriptionDifficulty
Email/PasswordEnabled by default, supports email verification and password resetEasy
Google OAuthGoogle account loginMedium
GitHub OAuthGitHub account loginMedium
WeChat LoginOptional, China only (enterprise qualification)Complex
SMS LoginOptional. Twilio for global numbers; Aliyun is China onlyComplex

Basic Configuration

.env
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:

social-auth.tsx
const defaultProviders: SocialProvider[] = ['google', 'github'];
// Optional China methods: 'wechat', 'phone'

Nuxt.js Application

Edit apps/nuxt-app/components/SocialAuth.vue:

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:

social-auth.tsx
const defaultProviders: SocialProvider[] = ['google', 'github'];
// Optional China methods: 'wechat', 'phone'

Basic Configuration

Application name, Logo, theme system and internationalization configuration

Email Password Authentication

Configure email verification and email delivery

On this page

Related PagesAuthentication Tech StackSupported Authentication MethodsBasic ConfigurationDetailed Configuration DocumentsFrontend UI ConfigurationNext.js ApplicationNuxt.js ApplicationTanStack Start Application