@replayio-app-building/netlify-recorder 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,12 +137,12 @@ The function is idempotent — calling it multiple times for the same request is
137
137
  - **`status: "queued"` or `"processing"`** — returns `null` without re-queuing
138
138
  - **`status: "captured"` or `"failed"`** — calls the service, updates status to `"queued"`, returns `null`
139
139
 
140
- By default, the blob data URL points to `${recorderUrl}/api/get-backend-request-blob?requestId=${requestId}`. If your app serves blob data from a different endpoint, pass a custom `blobDataUrl`:
140
+ The `blobDataUrl` must be a direct URL to the blob JSON (e.g. an UploadThing URL). The recording container fetches this URL directly no callback to the recorder service is involved:
141
141
 
142
142
  ```typescript
143
143
  const recordingId = await ensureRequestRecording(sql, requestId, {
144
144
  recorderUrl: RECORDER_URL,
145
- blobDataUrl: `https://your-app.netlify.app/api/get-blob?id=${requestId}`,
145
+ blobDataUrl: `https://utfs.io/f/${blobFileKey}`, // direct URL to stored blob data
146
146
  webhookUrl: "https://your-app.netlify.app/api/on-recording-complete", // optional
147
147
  });
148
148
  ```
@@ -411,7 +411,7 @@ Ensures a Replay recording exists (or is being created) for a backend request. L
411
411
  - `sql` — A Neon SQL tagged-template function
412
412
  - `requestId` — The backend request UUID
413
413
  - `options.recorderUrl` — Base URL of the Netlify Recorder service
414
- - `options.blobDataUrl` — Override the URL where the recording container fetches the blob JSON (defaults to `${recorderUrl}/api/get-backend-request-blob?requestId=${requestId}`)
414
+ - `options.blobDataUrl` — Direct URL where the recording container fetches the blob JSON (e.g. an UploadThing URL)
415
415
  - `options.webhookUrl` — URL to POST the result to when the recording completes or fails
416
416
 
417
417
  **Returns:** The recording ID (`string`) if the request is already recorded, or `null` if the recording was queued or is in progress.
package/dist/index.d.ts CHANGED
@@ -279,9 +279,10 @@ interface EnsureRequestRecordingOptions {
279
279
  recorderUrl: string;
280
280
  /**
281
281
  * Full URL where the recording container can fetch the blob JSON for this request.
282
- * Defaults to `${recorderUrl}/api/get-backend-request-blob?requestId=${requestId}`.
282
+ * Must be a direct URL to the blob data (e.g. an UploadThing URL). The container
283
+ * fetches this URL directly — no callback to the recorder service is involved.
283
284
  */
284
- blobDataUrl?: string;
285
+ blobDataUrl: string;
285
286
  /** URL to POST the result to when the recording completes or fails. */
286
287
  webhookUrl?: string;
287
288
  }
package/dist/index.js CHANGED
@@ -1075,12 +1075,11 @@ async function ensureRequestRecording(sql, requestId, options) {
1075
1075
  return null;
1076
1076
  }
1077
1077
  const recorderUrl = options.recorderUrl.replace(/\/+$/, "");
1078
- const blobDataUrl = options.blobDataUrl ?? `${recorderUrl}/api/get-backend-request-blob?requestId=${requestId}`;
1079
1078
  const res = await fetch(`${recorderUrl}/api/create-recording`, {
1080
1079
  method: "POST",
1081
1080
  headers: { "Content-Type": "application/json" },
1082
1081
  body: JSON.stringify({
1083
- blobDataUrl,
1082
+ blobDataUrl: options.blobDataUrl,
1084
1083
  handlerPath: request.handler_path,
1085
1084
  commitSha: request.commit_sha,
1086
1085
  branchName: request.branch_name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio-app-building/netlify-recorder",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Capture and replay Netlify function executions as Replay recordings",
5
5
  "type": "module",
6
6
  "exports": {