Using Chirai · Chapter 17

Connections

Connections let a site use data and services from outside, through proper APIs, never by copying other websites. Open them from Manage site → Shop & business → Connections.

Ready-made connections

ConnectionWhat it gives your siteNeeds a key?
WhatsApp Cloud APIOrder and return updates on WhatsAppYes
Google MapsMaps and placesYes
Weather, air quality, place search, currency rates, holidays, countriesLive data for pagesNo
India PIN codes, IFSC codesAddress and bank lookupsNo
Postcodes, Wikipedia, booksReference dataNo

A connection that needs no key is added with one click: press it, Chirai connects it, tries it, and shows you what your site will receive. One that needs a key opens a short form with a link to the page where you get the key.

Your own API

Add any API you have access to. Your site then reads it through Chirai's relay, so the key never reaches visitors' browsers. Keys are stored encrypted.

The easy way is to paste one example link from the API's documents into Manage site → Connections and press Read it. A curl command works too. Chirai works out:

  • the API's address
  • where the key goes (in the address, in a header, or as a Bearer token) and the key itself, if your link has it
  • which path your site may read

Check what it read, press Save and test, and Chirai calls the API with your example straight away and shows the answer. If the link from the documents only has a placeholder such as YOUR_API_KEY, paste your real key into the form before saving. Nothing is saved until you press Save.

Two limits: the API must use https://, and your site can only read from it (GET). An API that needs a sign-in window (OAuth) can't be connected this way yet.

How a connection reaches your pages

  1. Connect. Here, or automatically: when your description needs live data that a ready-made connection gives (weather, air quality, a city search, exchange rates …), Chirai connects it while it builds and writes the pages to read it.
  2. Pages read it. Each connection lists the pages that use it. If none does yet, ask IILA in the Studio, e.g. "Show live data from my weather connection on the home page."
  3. Visitors see it live, in the preview and on the live site; no publish needed. Every answer goes through Chirai, which keeps keys private, and each connection shows how often your site has called it.

Test makes one real call and shows what your site receives.

When your idea needs outside data

If your description mentions data from elsewhere (government portals, airline fares, live prices) IILA asks how it will arrive: an API you have, entered by you in Manage site, or not sure yet. The site keeps that data in its own tables, links to the official source, and reads outside data only through Connections.