Skip to content
← Public packages

@kentcdodds/sentry

Inspect Sentry organizations, projects, issues, and event summaries.

src/get-issue-events.ts

18 lines · 774 B · TypeScript
import { type IssueEventsInput, getIssueEvents, requireRecord, requireStringOrNumber } from './client.ts'

/**
 * List recent events for a Sentry issue.
 *
 * @param params.issueId - Sentry issue id (required).
 * @param params.limit - Max events to return.
 * @returns Array of event metadata records.
 * @example
 * import getIssueEvents from 'kody:@kentcdodds/sentry/get-issue-events'
 * const events = await getIssueEvents({ issueId: '7459536382', limit: 5 })
 * // => [{ id: '...', dateCreated: '...', title: '...' }]
 */
export default async function getIssueEventsEntrypoint(params: unknown) {
  const input = requireRecord(params, 'get-issue-events')
  requireStringOrNumber(input, 'issueId', 'get-issue-events')
  return getIssueEvents(input as IssueEventsInput)
}