Quickstart
This page takes you from nothing to a working GraphQL request against an audience, then shows the same call through an SDK. It uses Hot Mess as the example audience; swap in your own.
-
Find the audience. Every audience answers
GET /v1/brandingfor its hosts, with no credential.<subdomain>.admin.audiencekit.comworks for every audience; its own domain works once it is verified.Terminal window curl -s "https://api.audiencekit.com/v1/branding?host=hotmess.admin.audiencekit.com"The response carries
audience.id(a UUID), the audience’s name, the sign-in methods its apps offer, and its theme. Keep the id: it is the scope of every GraphQL request. See REST: Branding. -
Get a credential. Which one depends on who is calling:
You are building Use How you get it A server or website acting as one audience’s app An application API key From the audience’s admin console An app people sign in to A user token Sign the person in (Facebook, Apple, Google and others), then exchange that for a session A worker, bot or import job A service token Minted in the admin console with only the scopes it needs Authentication explains each one, and Service tokens walks through minting one.
-
Send a query. The audience is the query root, so this lists five of its venues:
Terminal window curl https://api.audiencekit.com/v1/audience/$AUDIENCE_ID/graphql \-H "Authorization: Bearer $AUDIENCE_KIT_API_KEY" \-H "Content-Type: application/json" \-d '{"query":"{ name venues { list(first: 5) { nodes { id name } } } }"}'Errors come back in the usual GraphQL
errorsarray, with anextensions.code; see Errors. A field from a module the audience hasn’t installed is refused asundefinedField, which the SDKs handle for you. -
Explore the graph. The GraphQL reference documents the consumer view one module at a time, with the permissions every field needs. Staff tools use the wider StaffQL view. Download the schema for your own tooling from
/graphql/schema.graphql. -
Check your documents in CI. Run the document validator against the published schema so a renamed or deprecated field fails your build, not your users.
The same call from an SDK
Section titled “The same call from an SDK”The SDKs sign people in, keep the session, send the API version header, and retry around modules an audience doesn’t have. They all speak to https://api.audiencekit.com by default.
import { AudienceKitClient } from "audience-kit";
const client = new AudienceKitClient({ configuration: { host: "hotmess.admin.audiencekit.com" },});// Sign in (or adopt a credential you minted), then read the audience.from audiencekit import Client, Configuration
client = Client(Configuration(host="hotmess.social"))# client.sign_in_with_facebook(...) or client.adopt(credential), then:venues = client.venues()See AudienceKit for Swift for the package, sign-in and the SwiftUI views.
See AudienceKit for Kotlin for Android and the JVM.
PHP, Rust and Ruby clients work the same way; the SDK overview lists them all.