Ruby SDK Deployment Cookbook¶
Opinionated guidance for packaging, deploying, and validating Sinatra-based extensions.
Scaffold & testing¶
kiket extensions scaffold my-ruby-extension --sdk ruby
# install dependencies with your preferred Ruby package manager
The scaffold includes replay fixtures, GitHub Actions, and .kiket/manifest.yaml. Use the CLI helpers:
kiket extensions lint
kiket extensions test
kiket extensions replay --template issue_created --url http://localhost:8080/webhooks/issue.created
Hosting patterns¶
- Heroku / Render / Fly.io – set
PORTand callsdk.run!(host: '0.0.0.0', port: ENV.fetch('PORT', 8080)). - Cloud Run – start the app with
ruby main.rb(or your preferred process manager) and configure min instances for latency-sensitive guards. - AWS Lambda / API Gateway – wrap
sdkwithRack::Handler::Lambda.
Always expose /health for readiness checks and keep idle timeouts ≥10 seconds, otherwise workflow.before_transition will fail.
Secrets & configuration¶
- Declare secrets in the manifest (
settings[].secret: true) and sync them viakiket marketplace secrets sync. - During deploys, set
KIKET_SECRET_<KEY>environment variables; the SDK hydratescontext[:settings]. - Use
context[:secrets].rotatewhen you need JIT credentials for downstream APIs.
Telemetry & logging¶
- Keep telemetry enabled so admins can see performance in the marketplace dashboard.
- Provide a
feedback_hook(e.g., ship JSON to STDOUT) to capture traces locally. - Wrap handlers in
begin/rescueonly for expected errors; re-raising ensures telemetry records the failure.
Custom data workflow¶
- Define schemas under
.kiket/modules/<namespace>/schema.yml. - Add
custom_data.permissionsto the manifest. - Use
context[:endpoints].custom_data(project_id)as a repository. - Guard access with role checks inside handlers if the module contains sensitive data.
Deployment checklist¶
-
kiket extensions lintandkiket extensions testpass. - Replay templates cover your critical workflows.
- Health endpoint returns
{"status":"ok"}. -
KIKET_WEBHOOK_SECRET,KIKET_WORKSPACE_TOKEN, and requiredKIKET_SECRET_*vars are set. - Telemetry shows up under Admin → Marketplace → SDK Telemetry after a dry run.