Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`beforeSend`: type `event_id` and `timestamp` as required

Open Beginner friendly
#25,286 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start by tracing _processEvent through prepareEvent to processBeforeSend, and find the beforeSend and beforeSendTransaction callback types in @sentry/core. Update their parameter types so prepared events require event_id and timestamp, then run the related TypeScript type checks and tests. Done when both callbacks expose those fields as required and existing callback return types remain unchanged.

Written by the indexing model from the issue text.

Description

Core Feature: Typescript Meta: Breaking
Problem Statement

beforeSend receives an ErrorEvent, which inherits event_id?: string and timestamp?: number from Event. But by the time beforeSend runs, both are always set: _processEvent only calls processBeforeSend with the result of prepareEvent, which does

event_id: event.event_id || hint.event_id || uuid4(),
timestamp: event.timestamp || dateTimestampInSeconds(),

So a common beforeSend use, like showing the user the event ID in a "report this error" link, needs a ! or a fallback that can never run.

Solution Brainstorm

Type the beforeSend parameter as ErrorEvent & { event_id: string; timestamp: number } (or a named "prepared event" type), and do the same for beforeSendTransaction. This only narrows a callback parameter, so existing callbacks still type-check, and the return type can stay ErrorEvent | null.

Additional Context

@sentry/core 11.6.0

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Dominant language
TypeScript
Stars
8.8k
Forks
1.9k
Avg merge
1d 10h
Merged PRs (30d)
588

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-javascript

All issues in getsentry/sentry-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.