Building with Supabase
Learn how to add authentication, database, and real-time features to your app with Supabase.
Building with Supabase
Supabase is an open-source Firebase alternative that provides all the backend services you need.
Features
- Authentication: Email, social, and magic link auth
- Database: PostgreSQL with real-time subscriptions
- Storage: File storage with CDN
- Edge Functions: Serverless functions
Quick Setup
- Create a Supabase project at supabase.com
- Get your project URL and anon key
- Install the client:
``bash
npm install @supabase/supabase-js
`
Authentication Example
`typescript
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(url, key);
// Sign up
const { data, error } = await supabase.auth.signUp({
email: "[email protected]",
password: "password123",
});
`
Database Queries
`typescript
// Fetch data
const { data, error } = await supabase
.from("posts")
.select("*")
.order("created_at", { ascending: false });
// Insert data const { data, error } = await supabase .from("posts") .insert({ title: "New Post", content: "Hello!" }); ``
You are ready to build!
Related Posts
Enjoyed this article?
Check out more posts or subscribe to our newsletter.