A Lovable site is a React app that runs in the browser, so your review API key can't go in its code: anyone could read it there. The answer is a Supabase Edge Function. It holds the key, fetches your Google reviews from a review API, keeps the answer for an hour, and hands the page only what it shows. The code for both parts is at the end, with a prompt you can give Lovable. Before you paste it, four choices decide how well it works, so make them on purpose.
TLDR
A Lovable site runs in the browser, so your review API key belongs in a Supabase Edge Function that fetches the reviews, never in the site's code.
The Reviewflowz API pulls your Google reviews without Google Business Profile access or Google's approval, and the same API returns reviews from 200+ platforms in the same fields.
A Reviewflowz review widget is one iframe you customize freely, so you show always-fresh Google reviews on a Lovable site without maintaining a function.
Reviewflowz tags let each page of your site ask for only the reviews that fit it, whether you tag reviews by hand or let AI tag them.
When to pull the reviews: at build, at page load, or in an iframe
You have three moments to get reviews onto a page, and each one trades speed, freshness and indexing differently.
Option | How it works | The tradeoff |
At build | The reviews are fetched when the site builds and written into the HTML. | The fastest, most efficient and most effective way, on frameworks that render pages ahead of time. |
Async at page load | The page loads the reviews after it opens. | It hurts how the page gets indexed and read. |
Iframe at page load | The page embeds a review widget in an iframe. | A decent tradeoff: always fresh, and still extremely fast, because the widget is loaded statically. |
Lovable sites render their pages in the browser, so the reviews load the same way as everything else on the page: at page load, from your Edge Function. If you want the fast option that is always fresh with no function to maintain, take the iframe.
The iframe, without building it. The Reviewflowz review widget is one iframe you customize as much as you like. We keep it fresh and load it statically, so it stays extremely fast. You find it in Integrations, on the Widgets tab.
Where the reviews come from: Places API, Business Profile API, or a review API
Your choice of source sets how many reviews you can show and how much setup stands between you and the first one.
Source | What you get | What it takes |
Google Places API | 5 reviews, a random sample. They can be old, and they can be bad. | A Google Cloud API key. |
Google Business Profile API | All the reviews of your own profile. | Approval first: you apply for access, and Google reviews requests within 14 days. Then OAuth, with owner or manager access to the profile. |
A third-party review API | All your reviews, and reviews from other platforms too. | An API key. No Business Profile access needed. |
Five reviews won't get you far. So in practice you need Business Profile access, through Google's approval, or a service that handles it for you.
No Business Profile access needed. The Reviewflowz API pulls your Google reviews without Business Profile access and without Google's approval, and the same API covers 200+ platforms in the same fields. Here is what it returns for Google.
Which reviews to show
Showing every review is the simplest choice, and rarely the best one. Decide these before you write any code:
All reviews, or a selection?
Selected by hand, or automatically?
With rules: a minimum rating, text required, newest first?
Filtered by topic, by location, by language, or by whatever fits the page?
The function below selects automatically, with rules: 6 reviews, 5 stars, with written text, still on Google, newest first. Each rule is one commented line, so you change it in place. Three more filters go further: language=en for reviews in one language, location=<id> for one of your locations, and tag=<id> for reviews you picked by hand or by AI tag.
Pick reviews per page with tags. In Reviewflowz you tag reviews by hand, or let AI tag them, and each page asks the API for its own tag. Lugg built its reviews page this way: visitors choose a use case and a city and read the reviews about exactly that, and about 6 to 9% of Lugg's new users land on a reviews page first. The testimonial feed guide shows the setup.
Reviews from Tripadvisor, Trustpilot and other platforms
If you want more than Google, you need a third-party review API here too. Some platforms, like Tripadvisor, forbid using your own reviews on your website. De facto, most people don't care. In general, it's best practice to link back to the original review, so those platforms don't bark.
The code below does that for Google: each review carries a url that opens it on Google, and the component shows it as a "Read on Google" link, so a visitor can check the review is real.
Other platforms, same call. With Reviewflowz, Tripadvisor, Trustpilot and the rest come through the same request: change platform, and the reviews come back in the same fields, each with its own url to link back to. The testimonial feed guide lists every filter.
Add Google reviews to your Lovable site, step by step
Step 1. In Reviewflowz, open Review Sources and click New review source. Pick Google Maps, then search for your business and select it.
Step 2. Open Settings → Webhooks & API and click Create an API key. Name it, pick Read only, and create it. The API is part of the Premium plan.
Step 3. Store the key as a Supabase secret named REVIEWFLOWZ_KEY: in Lovable, open Supabase → Edge Functions → Secrets, or run supabase secrets set REVIEWFLOWZ_KEY=... in a terminal. Step 4. Create the Edge Function supabase/functions/google-reviews/index.ts with this code. It holds the key, keeps the answer for an hour while it stays warm so each visitor doesn't cost an API call, and sends the browser only what the page shows:
// supabase/functions/google-reviews/index.ts
// A Supabase Edge Function: it holds your Reviewflowz key, so the key never
// reaches the browser. Set the key once with:
// supabase secrets set REVIEWFLOWZ_KEY=rfz_live_...
// (or in Lovable: Supabase → Edge Functions → Secrets).
const cors = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",
};
const params = new URLSearchParams({
platform: "google_maps", // Google reviews only
rating_min: "5", // 5 stars
has_text: "true", // with written text
removed: "false", // still on Google
sort: "date", // newest first
limit: "6", // how many to show
});
// Keep the answer for an hour while this function stays warm, so each
// visitor doesn't cost an API call.
let cached: { at: number; body: string } | null = null;
const ONE_HOUR = 60 * 60 * 1000;
Deno.serve(async (req) => {
if (req.method === "OPTIONS") return new Response("ok", { headers: cors });
if (!cached || Date.now() - cached.at > ONE_HOUR) {
const res = await fetch(`https://api.reviewflowz.com/v3/reviews?${params}`, {
headers: { Authorization: `Bearer ${Deno.env.get("REVIEWFLOWZ_KEY")}` },
});
if (!res.ok) {
console.error(`Reviewflowz API ${res.status}: ${await res.text()}`);
return new Response(JSON.stringify({ reviews: [] }), {
status: 502, headers: { ...cors, "Content-Type": "application/json" },
});
}
const { data } = await res.json();
// Send the browser only what the page shows.
const reviews = data.map((r: any) => ({
id: r.id, rating: r.rating, text: r.text, name: r.reviewer.name, url: r.url,
}));
cached = { at: Date.now(), body: JSON.stringify({ reviews }) };
}
return new Response(cached.body, { headers: { ...cors, "Content-Type": "application/json" } });
});
Step 5. Create src/components/GoogleReviews.tsx. It asks the function for the reviews through the Supabase client Lovable already set up:
// src/components/GoogleReviews.tsx
// Lovable's React app asks your Edge Function for the reviews; the function
// holds the key. `supabase` is the client Lovable already created for you.
import { useEffect, useState } from "react";
import { supabase } from "@/integrations/supabase/client";
type Review = { id: string; rating: number; text: string | null; name: string | null; url: string | null };
export default function GoogleReviews() {
const [reviews, setReviews] = useState<Review[]>([]);
useEffect(() => {
supabase.functions.invoke("google-reviews").then(({ data, error }) => {
if (error) console.error(error);
else setReviews(data.reviews);
});
}, []);
return (
<section className="google-reviews">
{reviews.map((review) => (
<figure key={review.id}>
<p aria-label={`${review.rating} out of 5 stars`}>{"★".repeat(Math.round(review.rating))}</p>
<blockquote>{review.text}</blockquote>
<figcaption>
{review.name}
{review.url && <a href={review.url} target="_blank" rel="noopener">Read on Google</a>}
</figcaption>
</figure>
))}
</section>
);
}
Step 6. Place <GoogleReviews /> where the reviews should appear. Once the function is live in your Supabase project, the reviews show up. The limit is 300 API calls a minute per account.
Prompt for Lovable: Add a Google reviews section to this site. Create a Supabase Edge Function named google-reviews that reads the secret REVIEWFLOWZ_KEY and fetches GET https://api.reviewflowz.com/v3/reviews?platform=google_maps&rating_min=5&has_text=true&removed=false&sort=date&limit=6 with the header "Authorization: Bearer" plus the key. Cache the answer for an hour and return only id, rating, text, reviewer name and url. Then create src/components/GoogleReviews.tsx that calls the function with supabase.functions.invoke("google-reviews") and shows each review's rating, text, name and a "Read on Google" link to its url. Never put the key in the React code. Follow the checklist in https://api.reviewflowz.com/v3/docs/guides/testimonial-feeds.
Want every option, filter and webhook in one place? Read Build a testimonial feed for every page. Running WordPress instead? Embed a review widget on WordPress.


