Refresh demos from CI

Refresh webhooks let your deploy pipeline queue new recordings for a project after a release.

Endpoint

text
POST https://littledemo.com/api/v1/webhooks/projects/{projectId}/refresh

Authenticate with the project webhook secret:

bash
curl -X POST https://littledemo.com/api/v1/webhooks/projects/proj_abc123/refresh \ -H "X-Webhook-Secret: whsec_xxx"

GitHub Actions

yaml
name: Deployon: push: branches: [main]jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Deploy app run: npm run deploy - name: Refresh LittleDemo demos run: | curl -X POST \ "https://littledemo.com/api/v1/webhooks/projects/${{ secrets.LITTLEDEMO_PROJECT_ID }}/refresh" \ -H "X-Webhook-Secret: ${{ secrets.LITTLEDEMO_WEBHOOK_SECRET }}" continue-on-error: true

Use continue-on-error if demo refreshes should not block production deploys.

Generic pipeline step

bash
if [ "$DEPLOY_STATUS" = "success" ]; then curl -X POST "https://littledemo.com/api/v1/webhooks/projects/$LITTLEDEMO_PROJECT_ID/refresh" \ -H "X-Webhook-Secret: $LITTLEDEMO_WEBHOOK_SECRET"fi

Response

json
{ "refreshed": 2, "jobs": [ { "demoId": "demo_abc", "jobId": "job_123" }, { "demoId": "demo_def", "jobId": "job_456" } ]}
Ask a question... ⌘I