← Public packages
@kentcdodds/sentry
Inspect Sentry organizations, projects, issues, and event summaries.
src/get-latest-issue-event.ts
17 lines · 769 B · TypeScriptimport { type IssueInput, getLatestIssueEvent, requireRecord, requireStringOrNumber } from './client.ts'
/**
* Fetch the most recent event for a Sentry issue.
*
* @param params.issueId - Sentry issue id (required).
* @returns Latest event payload (stack traces, breadcrumbs, tags).
* @example
* import getLatestEvent from 'kody:@kentcdodds/sentry/get-latest-issue-event'
* const event = await getLatestEvent({ issueId: '7459536382' })
* // => { id: '...', title: 'TypeError', entries: [...] }
*/
export default async function getLatestIssueEventEntrypoint(params: unknown) {
const input = requireRecord(params, 'get-latest-issue-event')
requireStringOrNumber(input, 'issueId', 'get-latest-issue-event')
return getLatestIssueEvent(input as IssueInput)
}