[DEV-4444] Add parameters to heartbeat and changeset - #2297
Conversation
🦋 Changeset detectedLatest commit: 4f593c5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-4444 |
There was a problem hiding this comment.
Pull request overview
This PR enhances webinar heartbeat tracking in the apps/nextjs-website Next.js app by extending the heartbeat payload with additional session context (start time, user consent, and webinar duration), and documents the change via a changeset.
Changes:
- Extend
WebinarHeartbeatParamsand POST payload to includestartedAt,consent, andduration. - Compute
durationand deriveconsentfrom the authenticated user attributes when sending heartbeats. - Add a changeset describing the patch change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/nextjs-website/src/lib/webinars/webinarHeartbeat.ts | Adds new heartbeat parameters to the request payload and updates the params type. |
| apps/nextjs-website/src/helpers/webinar.helpers.tsx | Sends additional heartbeat fields (startedAt/consent/duration) from the webinar hook. |
| .changeset/tricky-rules-lie.md | Declares a patch release for the heartbeat payload change. |
| import * as TE from 'fp-ts/lib/TaskEither'; | ||
| import { makeErrorByMessage } from '@/lib/makeError'; | ||
| import { Auth } from 'aws-amplify'; | ||
| import { date } from 'fp-ts'; |
| startedAt: webinar.startDateTime, | ||
| consent: user?.attributes['custom:webinar_accepted'] === 'true', | ||
| duration: durationMinutes, |
| "nextjs-website": patch | ||
| --- | ||
|
|
||
| Add parameters to the heartbeat api call |
|
This pull request is stale because it has been open for 14 days with no activity. If the pull request is still valid, please update it within 21 days to keep it open or merge it, otherwise it will be closed automatically. |
|
This pull request was closed because it has been inactive for 21 days since being marked as stale. |
List of Changes
This pull request enhances the webinar heartbeat tracking in the
nextjs-websiteapp by sending additional parameters with each heartbeat API call. These changes allow for more detailed tracking of webinar engagement and user consent.Webinar Heartbeat API Enhancements:
sendWebinarHeartbeatfunction now includesstartedAt,consent, anddurationparameters, providing more context about the user's session and acceptance status. [1] [2] [3]useUserhook and sent with the heartbeat. [1] [2]Other:
dateutility fromfp-tsto help with time calculations. [1] [2]Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: