RelynkLearn
Builder API

Build an app with Lovable

Connect Lovable to Relynk with a custom connector, share the connection, and build an app on your building data by describing it.

Set up a Relynk connector in Lovable once, connect your Relynk account to it, and then build apps on your building data by describing them in Lovable's chat.

A connector is how Lovable talks to another service. Lovable signs you in to Relynk, keeps the sign-in safe on its own servers and adds it to every request, so it never appears in your chat or in the app's code.

What others can see

A Relynk connection shows the data of the Relynk account that connected it. Everyone who uses the app, and everyone the connection is shared with, sees what that Relynk account can see. Connect with a Relynk account that has access to only what the app should show.

Before you start

  • Lovable: to create the connector you must be an admin or owner of the Lovable workspace. Other members only connect to it (part 2).
  • Relynk: an account with access to the buildings the app should show.
  • From your Relynk contact: the OAuth client ID and client secret for Lovable.
    • Client ID: ask your Relynk contact for it.
    • Client secret: Relynk sends it to you privately. Never paste it into a Lovable chat, a prompt or the app's code.

Part 1: Create the Relynk connector

A workspace admin or owner does this once for the whole workspace. The form has four sections, Details, Authentication, Data and Agent knowledge, and you fill them in from top to bottom. Every value below has a copy button: copy it and paste it into the field with the same name.

Open the form

In Lovable, open Connectors, select + in the top right, then select Custom connector ("Connect an API to your workspace"). The Create custom connector form opens.

Details

Open Details and fill in:

Display name
Relynk
Short description
Building data from Relynk: buildings, rooms, sensors and energy use.
Description
Read-only access to Relynk building data: buildings, rooms and equipment, sensor readings over time, and energy, water and waste consumption.

Logo (optional): download the Relynk icon below (relynk-icon-512.png), then select Upload logo and choose the file.

Relynk icon (512 × 512 PNG)
Relynk icon (512 × 512 PNG)
Download
Relynk logo, black (PNG)
Relynk logo, black (PNG)
Download
Relynk logo, white (PNG)
Relynk logo, white (PNG)
Download

Category: select Other.

Documentation URL (optional)
https://learn.relynk.io/docs/builder/lovable

Authentication

Open Authentication. Under Method, select OAuth 2.0, then fill in:

Authorization URL
https://auth.relynk.io/authorize?audience=https%3A%2F%2Fai.relynk.io%2Fbuilder
Token URL
https://auth.relynk.io/oauth/token
Scopes (optional)
openid
offline_access
  • Scope separator (optional): leave it empty.
  • Use PKCE: turn it on.

The Authorization URL ends with ?audience=… on purpose: it tells Relynk's sign-in which API the sign-in is for (https://ai.relynk.io/builder). Without it, signing in works but every request fails with 401.

Below Use PKCE the form shows Add this redirect URL to the service's OAuth app settings. It should read:

Redirect URL (shown by Lovable, nothing to enter)
https://api.lovable.dev/workspaces/connectors/standard/oauth/callback

Relynk has already allowed this address, so there is nothing to do. If your form shows a different address, send it to your Relynk contact before you connect (part 2).

Further down in Authentication, fill in:

API base URL
https://ai.relynk.io/builder/v1

Under Test request, leave Method on GET and enter:

Path
/me

A connector cannot switch between OAuth 2.0 and another method later. If you chose the wrong method, delete the connector and create it again.

Data

Open Data and select Personal data ("In chat, only the person who connected can use it").

Relynk shows each person what their own Relynk account may see, so in Lovable's chat everyone should use their own connection. Apps still use the connection linked to them; see What others can see.

Agent knowledge

Knowledge files teach Lovable how to use Relynk. Add all seven, in this order. For each file, copy the Name, the Description and the Content into the fields with the same name:

The files hold no credentials and no addresses, and together they are well under Lovable's limits (50 files per connector, 50,000 characters each, 256 KB in total).

Create

Select Create. Relynk now appears in the workspace's connector catalog.

Part 2: Connect your Relynk account

Each person who builds with Relynk data does this once.

Add a connection

Open Connectors, find Relynk, and select Add connection.

Enter the client ID and secret

Client ID
ask your Relynk contact for it

Client secret: your Relynk contact sends it to you privately. Enter it only in this form, never in a chat, a prompt or the app's code.

Sign in to Relynk

A window opens with Relynk's sign-in. Sign in with the Relynk account whose data you want to build with.

Choose who can use the connection

Under Sharing, choose who may use it: only you (the default, shown as Private), specific people, or the whole workspace. Everyone you share with sees what your Relynk account can see.

Check the connection

Lovable sends the test request (GET /me). When it succeeds, the connection is ready. If it fails, see Troubleshooting.

Link the connection to the Lovable projects that should use Relynk data.

Lovable encrypts the client secret and your sign-in and adds them to requests on its own servers. They never appear in the chat or in the project's code.

Part 3: Build your app

Start a project, link the Relynk connection, and paste this as your first prompt. Replace the last line with what you want to build.

Starter prompt
Build an app on my Relynk building data, using the Relynk connector for every Relynk request.
Before writing code, read the Relynk knowledge files, starting with "Relynk guide".
Start with GET /me. If it lists more than one tenant, let me choose one and add ?tenantId=<id> to every request.
Look up type keys with resourceTypes.list instead of guessing them.
Show null as missing data, never as 0, and show times in Europe/Oslo.

What I want: <describe your app>

Example prompts

  • "Show a dashboard of room temperatures in my building."
  • "Chart the hourly temperature of every room on level 2 for the last week."
  • "List the five warmest and the five coldest rooms last month."
  • "Show electricity, heating and water use per month this year, with the data quality next to each number."
  • "Make a page where I pick a building and see its rooms, equipment and sensors."

Ask for one thing at a time, check it, then ask for the next.

What others can see

  • Everyone using the app sees the data of the Relynk account that connected, whether they have a Relynk account themselves or not. Put the app behind Lovable's own login if the data should not be public.
  • Everyone the connection is shared with can build apps with that same data.
  • Use a Relynk account with access to only the buildings the app should show. Your Relynk contact can set one up.

Troubleshooting

On this page