Integration guide
Four connectors exist: Slack and GitHub over OAuth, an HTTP endpoint and an outbound webhook over stored secrets. This guide covers the configuration each one needs and the checks the server performs.
Environment
Provider client ids are public identifiers; secrets never enter the web app's environment.
| Variable | Used by | Notes |
|---|---|---|
| AURELITH_SLACK_CLIENT_ID | beginIntegrationConnect | Required to start the Slack OAuth flow; absence raises a configuration error. |
| AURELITH_GITHUB_CLIENT_ID | beginIntegrationConnect | Required to start the GitHub OAuth flow. |
| AURELITH_SECRET_PROJECT | Secret Manager access | Project that holds connection secrets. |
| AURELITH_ALLOWED_ORIGINS | Callable CORS | Comma-separated; a wildcard is rejected when App Check enforcement is on. |
Client secrets for OAuth providers are stored in Secret Manager and referenced from the integration record. The callback exchange happens server-side with the stored secret.
The connection flow
Six steps, each with an explicit failure.
- 1 · beginIntegrationConnect
- Requires an admin role and the integrations-connect entitlement. Creates a single-use state bound to uid, org and provider with an expiry, and consumes an App Check token.
- 2 · Authorize
- For OAuth providers the response carries the provider's authorize URL. The browser redirects there; nothing else is trusted from the client.
- 3 · Callback
- The provider returns to /app/integrations/callback. completeIntegrationCallback verifies the state before exchanging the code.
- 4 · Secret storage
- Secret-mode providers skip steps 2–3: the pasted token is written to Secret Manager and only its version reference is stored in Firestore.
- 5 · Host allowlist
- The connection records an allowed-host list: provider defaults plus admin additions. An HTTP integration without at least one host is rejected.
- 6 · Health
- A scheduled sweep tests connections up to 200 per tick and drives each circuit breaker between closed, half-open and open.
Verifying outbound webhooks
Deliveries are signed with the connection's signing secret; retries run at 0, 1, 5 and 25 minutes.
// Verify an outbound-webhook delivery (Node)
import { createHmac, timingSafeEqual } from "node:crypto";
const header = req.headers["x-aurelith-signature"]; // "t=<seconds>,v1=<hex>"
const [tPart, vPart] = String(header).split(",");
const timestamp = Number(tPart.slice(2));
const expected = createHmac("sha256", signingSecret)
.update(`${timestamp}.`)
.update(rawBody)
.digest(); // Buffer
const received = Buffer.from(vPart.slice(3), "hex");
const valid =
received.length === expected.length && timingSafeEqual(received, expected);The signature header is t=<unix seconds>,v1=<hex> over "<t>.<raw body>". Compare with a constant-time equality check and reject timestamps outside your tolerance window.
A delivery is claimed with a 60-second lease before it is sent, so overlapping worker runs cannot double-send. After four failed attempts the delivery is terminal, audited, and the organisation's admins are notified.
Failure codes you will see
| Code | Meaning |
|---|---|
| INTEGRATION_AUTH_FAILED | The provider rejected the credential. Reconnect. |
| INTEGRATION_RATE_LIMITED | The provider rate-limited the call; retry later. |
| INTEGRATION_UNAVAILABLE | The provider returned 5xx or could not be reached; the circuit may open. |
| ENTITLEMENT_DENIED | The organisation lacks the integrations-connect entitlement. |
| DOCUMENT_INVALID | The configuration or allowlist is invalid (reason: invalid_allowlist, allowlist_required). |
Connect one
The workspace catalog shows each provider's capabilities and what leaves the workspace before you authorise it.