Skip to content

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

Package listing

@kody/sentry

src/list-organizations.ts

17 lines · 707 B · TypeScript
import { type ListOrganizationsInput, listOrganizations, requireRecord } from './client.ts'

/**
 * List Sentry organizations accessible to the saved auth token.
 *
 * @param params.host - Optional API host. Default `sentry.io`.
 * @returns Array of organization slugs and metadata.
 * @example
 * import listOrganizations from 'kody:@kody/sentry/list-organizations'
 * const orgs = await listOrganizations()
 * // => [{ slug: 'acme', name: 'Acme' }]
 */
export default async function listOrganizationsEntrypoint(params: unknown = {}) {
	if (params == null) return listOrganizations({})
	const input = requireRecord(params, 'list-organizations')
	return listOrganizations(input as ListOrganizationsInput)
}