First deployment
An HTTP Chattice app is an ASGI service. Any platform that provides a stable
public HTTPS URL and preserves the request body and Authorization header can
host it.
Container command
uvicorn app:app --host 0.0.0.0 --port "${PORT:-8080}"
Configure these as runtime secrets/settings:
CHATTICE_AUDIENCE: exact endpoint URL or project number selected in the Chat API configuration.- Service-account credential path or workload identity configuration, only if the app makes outbound Chat API calls.
Cloud Run checklist
- Build and deploy the ASGI container.
- Decide whether Cloud IAM or the application verifier is responsible for authenticating Chat. Do not accidentally require two incompatible audience configurations.
- Put the final HTTPS URL in the Chat API configuration and use the same URL
as
CHATTICE_AUDIENCEwhen application-level verification is enabled. - Restrict app visibility to testers before a wider rollout.
- Send a direct message, a Space mention, and the configured
/deploycommand. Inspect structured logs without logging tokens or private form values.
Google Chat can retry failed HTTP deliveries, so make side effects idempotent. See Deployment and operations for retries, observability, secrets, and Pub/Sub deployment.
Next: Recommended project structure.
Live test checklist (15 minutes)
- In the Google Cloud Console, set the app to Live mode and choose
the HTTP endpoint (
https://your-domain/). - Set
CHATTICE_AUDIENCEto exactly that URL (trailing slash matters). - Deploy the app;
curl https://your-domain/healthzmust answer 200. - In Google Chat, open a DM with the app → send a message → the handler answer must appear within seconds.
- Add the app to a test Space → mention the app → check the answer.
- Test a card: trigger the card handler, click a button, confirm the update/action response.
- Test private: trigger the private flow with two accounts in the Space; the second account must NOT see the private card.
- Test a Dialog: open it from a button, submit, check the banner.
- Watch
journalctl -u <service> -fduring every step; a 401 means audience mismatch, a 403 means the app is not a Space member or lacks scopes.