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.ts

18 lines · 709 B · TypeScript
import { type IssueInput, getIssue, requireRecord, requireStringOrNumber } from './client.ts'

/**
 * Fetch one Sentry issue by numeric id.
 *
 * @param params.issueId - Sentry issue id (required).
 * @param params.host - Optional API host. Default `sentry.io`.
 * @returns Full issue record from the Sentry API.
 * @example
 * import getIssue from 'kody:@kody/sentry/get-issue'
 * const issue = await getIssue({ issueId: '1234567890' })
 * // => { id: '1234567890', title: '...', count: 12 }
 */
export default async function getIssueEntrypoint(params: unknown) {
	const input = requireRecord(params, 'get-issue')
	requireStringOrNumber(input, 'issueId', 'get-issue')
	return getIssue(input as IssueInput)
}