Contract v1 · generated reference
Code examples
Executable syntax with placeholders—never embedded credentials, customer data or live endpoints.
The waitlist compatibility wrapper is the only current operation whose complete HTTP request schema is producer-proven. Other operation pages fail closed with an explicit unresolved status instead of publishing a guessed payload.
async function submitWaitlist(fetchSandbox) {
const response = await fetchSandbox("https://REGION-PROJECT_ID.cloudfunctions.net/waitlist", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Firebase-AppCheck": "APP_CHECK_TOKEN",
},
body: JSON.stringify({
email: "PERSON@example.test",
website: "",
idempotencyKey: "IDEMPOTENCY_KEY",
}),
});
if (!response.ok) throw new Error(`HTTP_${response.status}`);
return response.json();
}
globalThis.__examplePromise = submitWaitlist(globalThis.fetchSandbox);curl --fail-with-body --request POST \
--url https://REGION-PROJECT_ID.cloudfunctions.net/waitlist \
--header 'Origin: https://APPROVED_SANDBOX_ORIGIN' \
--header 'X-Firebase-AppCheck: APP_CHECK_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"email":"PERSON@example.test","website":"","idempotencyKey":"IDEMPOTENCY_KEY"}'function recoveryFor(code) {
if (code === "RATE_LIMITED") return "WAIT_FOR_RETRY_AFTER";
if (code === "CONFLICT") return "RELOAD_AND_RECONFIRM";
if (code === "UNAVAILABLE") return "BOUNDED_BACKOFF";
return "STOP_AND_ESCALATE";
}
globalThis.__exampleResult = recoveryFor("CONFLICT");# Error recovery is a client decision, not a second HTTP request.
# Preserve the privacy-safe correlation id and follow the operation contract.Copy buttons announce success or a manual-copy fallback. Language tabs support arrow-key navigation and every code block is keyboard scrollable.
Common integration contract
Sandbox and Production are isolated
Run examples only in a governed sandbox or local emulator. Sandbox identities, App Check tokens, payment fixtures and data do not grant Production access. The typed ports do not ratify a public numeric quota; enforcement may be stricter. Honor RATE_LIMITED and the server's retry-after value.
Authentication and authorization
Firebase Auth proves identity. App Check proves the approved app where a callable requires it. Roles, organization membership, requester identity and resource ownership are derived and rechecked by the server.
Authentication guideErrors and recovery
Stable error codes distinguish validation, denial, conflict, expiry, authority pending, rate limiting and temporary unavailability. Never infer success from an HTTP redirect or a browser state.
Error catalogueIdempotency, concurrency and retry
Reuse an idempotency key only for an identical retry. A new intent needs a new key. Preserve version preconditions and reload after a conflict.
Retry guidanceChanges and escalation
Check compatibility before adopting a new contract version. Review the changelog, service status and support guidance before retrying a persistent failure.
| Family | Client decision |
|---|---|
| Authentication / authorization | Refresh or step up only when instructed; do not retry a denial unchanged. |
| Validation / conflict / expiry | Correct or reload state, then obtain confirmation for a new intent. |
| Rate limited / unavailable | Honor retry-after and use bounded backoff; inspect service status. |
| Unknown / server | Fail closed and escalate with a privacy-safe correlation id. |
Executable network examples are published only when the exact wire schema is producer-proven. Check the selected operation's example-availability status; an unresolved schema is a release blocker, not permission to guess.
Verified examples and local-only recovery snippets