App builder
Lovable + SocialHelper
Give the app you’re building in Lovable a share button: it calls the SocialHelper API from a server function, with your API key kept in Lovable’s secrets.
Setup
Set it up in Lovable.
About five minutes, from key to first post.
Source: Lovable documentation ↗
-
1
Create an API key
In the SocialHelper dashboard, open Developers and create a key. It starts with sh_ and is shown once, so copy it somewhere safe.
-
2
Store the key as a secret
Turn on Lovable Cloud and add a secret named SOCIALHELPER_API_KEY under Cloud → Secrets. Lovable calls outside APIs from an Edge Function, so the key stays on the server. Never give a secret the VITE_ prefix: those values end up in the browser.
-
3
Ask Lovable to build the share function
Paste this prompt into Lovable:
Add a “Share” button that posts the selected update to my social accounts. Create a server-side function that sends POST https://socialhelper.app/api/v1/posts with the header “Authorization: Bearer ” followed by the secret SOCIALHELPER_API_KEY, and a JSON body with “text” and “accounts”. Load the account IDs from GET https://socialhelper.app/api/v1/accounts. Never put the API key in client-side code. -
4
Check the function
It should look roughly like this: the key comes from the secret, and the browser only ever talks to your function.
// supabase/functions/share/index.ts (a Supabase Edge Function) // Protect this function so only you, or your signed-in users, can call it. Deno.serve(async (req) => { const { text, accounts } = await req.json(); const response = await fetch("https://socialhelper.app/api/v1/posts", { method: "POST", headers: { Authorization: `Bearer ${Deno.env.get("SOCIALHELPER_API_KEY")}`, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ text, accounts }), }); return new Response(await response.text(), { status: response.status, headers: { "Content-Type": "application/json" }, }); });
Ship it from Lovable.
Create a free account, connect an account and send your first post in a few minutes.