This example SaaS project demonstrates how to build a simple SaaS with Kobble and Supabase.
- Supabase is used for the database and server side code execution (using edge functions).
- Kobble is used for authentication and monetization.
Using npm in your project directory run the following command:
npm install
npm run dev
Create an Application in your Kobble Dashboard.
Make sure your application can handle your localhost callback URL (see section below).
Note the Client ID and your Portal Domain values.
Copy the .env.example
file to .env
and update the values with your Kobble Application details.
cp .env.example > .env
Example:
VITE_KOBBLE_DOMAIN=**********
VITE_KOBBLE_CLIENT_ID=**********
VITE_KOBBLE_REDIRECT_URI=http://localhost:5173/callback
VITE_SUPABASE_URL=**********
VITE_SUPABASE_API_KEY=**********
Create a new project on Supabase.
Add the correct RLS policies to the tables and storage (docs coming soon).
Asks us for more details if you need help.
Allow user's images read access
create policy "read user images" on "public"."Images" as permissive for select to authenticated using ((request_user_id() = user_id));
Allow service_role (edge function) to persist images
create policy "insert images from service_role" on "public"."Images" as permissive for insert to service_role with check (true);
Supabase functions are located in the same repo.
Copy the supabase/functions/.env.example
file to supabase/functions/.env
and update the values with your details.
DEZGO_API_KEY=GENERATE_FROM_YOUR_DEZGO_DASHBOARD
KOBBLE_SECRET_KEY=GENERATE_FROM_YOUR_KOBBLE_DASHBOARD
Note: the Dezgo API Key can be generated on the Dezgo Dashboard and is used to generate images from the Edge Function Backend.
Deploy the Supabase functions to your Supabase project.
cd supabase/functions
npm run supabase:deploy # will deploy environment and functions
To provide feedback or report a bug, please raise an issue on our issue tracker.
Kobble is the one-stop solution for monetizing modern SaaS and APIs. It allows to add authentication, analytics and payment to any app in under 10 minutes.