Skip to content
AstroWay/api v2.325.0 · integrations
all systems operational

Lovable

Last updated View as Markdown Agent setup

Lovable builds the frontend with Vite and puts the backend in its built-in Cloud on Supabase. That gives one rule: the AstroWay key lives in Secrets and is read by an Edge Function, and the browser calls the function. A VITE_* variable will not do even for a moment: Vite bakes it into the bundle every visitor downloads.

Create a Server only key scoped to chart with a budget, as described in A key for an automation. The budget matters here: anyone who opens your published app can call the function.

Paste into the project chat:

prompt
Add an Edge Function named big-three. It reads the secret ASTROWAY_API_KEY
(ask me for it with the secure secret form) and POSTs the JSON body
{ date, time, timezone, latitude, longitude } to
https://api.astroway.info/v1/chart with the header "X-Api-Key: <secret>".
Never put the key in client code or in a VITE_ variable.
The response is { ok: true, data: {...} } or { ok: false, error: { code,
message } }. On error return the error object with the same HTTP status.
On success return { sun, moon, rising, offset_used } where each sign is
SIGNS[Math.floor(longitude / 30)] with SIGNS = Aries, Taurus, Gemini,
Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius,
Pisces; sun and moon come from data.planets entries named "Sun" and
"Moon", rising from data.houses.ascendant, offset_used from
data.input.timezoneOffset.
Then add a form with date, time, an IANA time zone (default Europe/Kyiv),
latitude and longitude, and show the three signs from the function.

Lovable asks for the ASTROWAY_API_KEY value in a secure form in the chat. You can replace the secret later under More → Settings → Secrets: values there are write-only and cannot be viewed again.

The function Lovable should end up with is in essence the one on Supabase Edge Function. If the generated code differs, paste that file and ask Lovable to use it.

Enter 1990-05-15, 14:30:00, Europe/Kyiv, 50.45, 30.52. The right answer: Sun Taurus, Moon Capricorn, rising Virgo, offset 4. An offset of 3 means the app works out the offset itself instead of sending the zone name, and every house is shifted. One calculation costs 20 credits.

So that Lovable takes field and endpoint names from our documentation rather than guessing, connect the docs server as a chat connector. It needs no key and spends no credits.

  1. Connectors → Add custom → MCP server.
  2. Server name AstroWay docs, Server URL https://mcp.astroway.info/mcp/docs.
  3. Authentication: No authentication.

You can then write in the chat, for example, “Using AstroWay docs, find the endpoint for a daily horoscope by sign and add it”. A chat connector works only while you build and never reaches the published app, so calculations in the app still go through the Edge Function.