Start your
first habit today.
Free forever. No credit card required. Cancel anytime.
OR
Please enter your name
Please enter a valid email
Enter a password
Password must be at least 8 characters
By creating an account you agree to our Terms of Service and Privacy Policy.
Good morning,
Alex.
You're on a streak. Don't break it today.
PLAN
Free
3 habits max
HABITS
0
active
BEST STREAK
0
days
MEMBER SINCE
Today
 
Authentication Setup Guide
STRIVE uses Supabase for authentication — free tier handles up to 50,000 monthly active users. Takes about 15 minutes to set up.
1
Create a free Supabase project
Go to supabase.com → New project. Choose a region close to your users (Europe for Brussels). Once created, go to Settings → API and copy your Project URL and anon public key.
FREE TIER
2
Add Supabase to your project
Replace the config values at the top of your auth script:
// Replace these with your real Supabase credentials: const SUPABASE_URL = 'https://YOUR_PROJECT.supabase.co'; const SUPABASE_KEY = 'YOUR_ANON_PUBLIC_KEY';
3
Create the users table in Supabase
Go to Supabase Dashboard → SQL Editor → run this query:
-- Create profiles table linked to auth users create table profiles ( id uuid references auth.users on delete cascade, name text, plan text default 'free', stripe_customer_id text, created_at timestamp default now(), primary key (id) ); -- Auto-create profile on signup create or replace function handle_new_user() returns trigger as $$ begin insert into public.profiles (id, name) values (new.id, new.raw_user_meta_data->>'name'); return new; end; $$ language plpgsql security definer; create trigger on_auth_user_created after insert on auth.users for each row execute procedure handle_new_user();
4
Enable Google & Apple OAuth
In Supabase Dashboard → Authentication → Providers:
Google OAuth: 1. Go to console.cloud.google.com 2. Create OAuth 2.0 credentials 3. Add redirect URL: https://YOUR_PROJECT.supabase.co/auth/v1/callback 4. Paste Client ID + Secret into Supabase Apple OAuth: 1. Go to developer.apple.com 2. Create a Services ID 3. Add redirect URL: https://YOUR_PROJECT.supabase.co/auth/v1/callback 4. Paste credentials into Supabase
5
Connect Stripe + Supabase (link plan to user)
When a Stripe payment completes, update the user's plan in Supabase via your webhook:
// In your Stripe webhook handler: if (event.type === 'checkout.session.completed') { const session = event.data.object; const email = session.customer_email; const plan = session.metadata.plan; // 'monthly','yearly','lifetime' // Update user plan in Supabase const { error } = await supabase .from('profiles') .update({ plan, stripe_customer_id: session.customer }) .eq('email', email); }
6
Protect app routes based on plan
Check the user's plan before showing premium features:
// At the top of your app: const { data: { user } } = await supabase.auth.getUser(); if (!user) { window.location.href = '/auth'; return; } const { data: profile } = await supabase .from('profiles') .select('plan') .eq('id', user.id) .single(); const isPro = ['monthly','yearly','lifetime'].includes(profile?.plan); const MAX_HABITS = isPro ? Infinity : 3; // Show upgrade prompt if free user hits limit: if (!isPro && habits.length >= 3) { showUpgradeModal(); }
7
Save habits to Supabase (persistent data)
Replace localStorage with Supabase so habits persist across devices:
-- Create habits table create table habits ( id uuid default gen_random_uuid() primary key, user_id uuid references profiles(id) on delete cascade, name text not null, icon text, schedule text default 'daily', is_negative boolean default false, limit_count int, created_at timestamp default now() ); create table habit_logs ( id uuid default gen_random_uuid() primary key, habit_id uuid references habits(id) on delete cascade, user_id uuid references profiles(id) on delete cascade, completed_at date default current_date, unique(habit_id, completed_at) );
ENABLES CROSS-DEVICE SYNC