Day 3: Integrations with Lovable


Continuing my journey building with Lovable. This time, I’m learning how to integrate external APIs to build chatbots and subscription plans into my Lovable web app.
I’m still using the Lovable Academy Intermediate Course for this:
Integrations in Lovable
Lovable has 3 types of integrations— native, verified and “bring-your-own"
Native integrations are those that Lovable is optimised to work with; i.e., Lovable is pre-built to work well with these (Supabase & GitHub)
Verified integrations are those that have been tested to work well with Lovable. Lovable is familiar with and works well with these external APIs
“Bring-your-own” integrations are those that Lovable may not be familiar with but could still use if given additional context and instructions.
API Key Security— Always use Supabase's secret manager to securely store API keys. Avoid placing keys directly into Lovable's chat or UI to prevent security vulnerabilities. Supabase safely manages these sensitive details.
Integrating Google Gemini to Build a Chatbot
Lovable Integrations with Supabase Edge Functions— Lovable integrates external APIs using Supabase Edge Functions. These are lightweight, efficient scripts executed at the edge of your application's network. They enable your application to securely interact with external APIs without exposing sensitive data such as API keys directly in your application's UI or codebase.
Steps to Integrate Google Gemini to Build a Chatbot
(1) Connect Supabase → ensure your Supabase account is connected to your Lovable project
(2) Prompt Lovable to add a chatbot UI → e.g. “
Add a chatbot to the bottom right-hand corner. We will add the external API later. Focus on the UI first
”(3) Prompt Lovable to integrate API → instruct Lovable to integrate the desired API: “
Add Google Gemini API functionality to the chatbot using Supabase Edge Functions
”(4) Securely add your API keys → Lovable will prompt you to enter an API key. Put it into the secure window that Lovable provides; NEVER directly into the chat interface itself.
(5) Deploy and verify → Lovable handles the setup and configuration of the external EPI using Supabase Edge Functions. Verify that the chatbot works correctly by trying to interact with it.
Integrating Stripe to Build a Pro Subscription Tier
Steps to integrate Stripe to Build a Pro Subscription Tier
(1) Connect Supabase → ensure your Supabase account is connected to your Lovable project
(2) Prompt Lovable to add Stripe functionality → e.g., “
Enable Stripe checkout for a pro subscription
".(3) Configure Stripe → Login to Stripe Dashboard, turn on test mode and create a new product.
Go to https://dashboard.stripe.com/test/settings/billing/portal and ensure the customer portal link is set to “Active” to ensure customers can manage their subscriptions.
(4) Add API Key securely → get your Stripe API key by going to Developers > Secret key, then paste this into the window form Lovable’s prompt (not directly into the chat or UI)
(5) Deploy and verify → Update your Lovable project witht he new changes and test out the Stripe pro subscription feature using test card data. Both Stripe and Supabase should update to reflect new subscribers.
Subscribe to my newsletter
Read articles from Zephan Hwang directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Zephan Hwang
Zephan Hwang
Mastering AI and machine learning, one step at a time.