Skip to content

Documentation · Connect · 1 min read

Connect a service

Add public details, check the connection, and use it from code or Sanic AI.

Add a connection

Open Connectors in the rail and choose a service: Supabase, WordPress, Shopify, RevenueCat, OneSignal, Algolia or Sentry. Each asks only for the public details a client app may hold, such as a project address, a publishable key or an App ID. Private and service keys are refused.

Every connector has a Test and a Live configuration. Switching the active one changes previews and future builds, not an app that is already installed.

  1. Give the connection a name and enter the public details for Test, and for Live when you have them.
  2. Choose Check connection. A read-only check confirms the details answer and lists what it found.
  3. Enable and save the connection.

Use it in code

Import getConnector (or getSupabase for Supabase) from @appsanic/connectors with your connection's id, which the generated guide lists. Some services only run in a native build: check availability.supported and show availability.reason before offering such an operation.

Responses come back as untyped values that your code checks before using. Your app talks to the service directly, under that service's own access rules.

import { getConnector } from "@appsanic/connectors";

const store = getConnector("my-shop");
if (store.availability?.supported) {
  const result = await store.request("products.list", { first: 12 });
  // Check the shape of `result` before using it.
}

With Sanic AI

Sanic AI sees which services are connected and what each can do, and reads the generated connector interface, so it can write services, hooks and bindings against them. It never sees the values you entered. When a request needs a service that is not connected, it asks you to connect it in Connectors rather than in chat.

Where each service runs

Supabase, WordPress, Shopify and Algolia work in the browser preview, in Expo Go and in a native build. RevenueCat, OneSignal and Sentry need a native development or release build: the preview and Expo Go cannot run their SDKs.

A successful connection check proves that one configuration answers. Test the complete flow in the preview and on a device before you rely on it.

All guides