Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/sentry

src/get-issue-events.ts

19 lines · 829 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.
 * @param params.host - Optional API host. Default `sentry.io`.
 * @returns Array of event metadata records.
 * @example
 * import getIssueEvents from 'kody:@kody/sentry/get-issue-events'
 * const events = await getIssueEvents({ issueId: '1234567890', 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)
}