Supabase Integration
Explore how to connect Supabase with your Trickle application.
Supabase is a powerful open-source backend-as-a-service (BaaS) platform designed to help developers build and scale web and mobile applications.
It’s a robust alternative to Firebase, offering a range of features such as a PostgreSQL database, real-time data synchronization, secure authentication and authorization, file storage, and serverless edge functions. Supabase is highly flexible, giving developers the freedom to self-host or use its managed services, making it an ideal choice for projects that require scalability, performance, and control.
Supabase setup
Connecting your Trickle app to Supabase is quick and easy. Just follow these simple steps to get started:
Step 1 - Create a Supabase Account
Set up your Supabase account. You can create a new account here, or log in if you already have one.
Step 2 - Create a New Project
Once logged in, navigate to the Projects dropdown and click ‘+ New Project’ to create a new Supabase project.
Step 3 - Connect Supabase to Trickle
To link your Supabase project with your Trickle app, follow these steps:
- At your project Home, scroll down to ‘Connecting to your new project.’ Get your Supabase Project URL and the Anonymous Public API Key.
2. Copy your Trickle App Link.
3. Go to Authentication and click on URL Configuration in Supabase. Paste the Trickle App Link into the Site URL and click Save. By doing this, your Supabase project will redirect to this site url when your app user finish account sign up and email verification.
Trickle setup
Go back to Trickle and navigate to the specific project you want to connect to Supabase:
Step 1 - Knowledge Configuration
Copy the following setup instructions into the Knowledge panel. Insert your Project URL and Anonymous Public API Key into the corresponding fields, and replace the Site URL for Authentication and Redirect URL with your own values.
Step 2 - Add account sign-up and sign-in functionality using Supabase authentication
-
Prompt “Add login/signup page using Supabase,” and Trickle AI will automatically build the onboarding page and integrate it with Supabase using the authentication API.
-
Create an account on your Trickle App. When you sign up with your email, Supabase will send a verification email to your address.3. Check the user account in your Supabase project.
Step 3 - Save and Retrieve Data with Supabase
Save or fetch data using the Supabase database. By using a prompt like “Save data using Supabase database,” Trickle AI will automatically generate the data structure and utilize the Supabase database API to save or retrieve data. Below is an example:
- Prompt “All logged-in users can submit questions or answer other users’ questions, and save the questions using the Supabase database.”2. Copy and paste the SQL file content into your Supabase project and run the SQL script. 3. Now you can create a new question in your app and save data to your Supabase database.