Skip to content

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

Package listing

@kentcdodds/producthunt

src/get-viewer.ts

14 lines · 527 B · TypeScript
import { getViewer } from './domain.ts'
import type { ProductHuntIntegrationOptions } from './types.ts'

/**
 * Return the connected Product Hunt hunter from `viewer.user`.
 * Requires the `private` OAuth scope.
 * @example
 * import getViewer from 'kody:@kentcdodds/producthunt/get-viewer'
 * const me = await getViewer()
 * // => { id: '...', name: 'Kent C. Dodds', username: 'kentcdodds' }
 */
export default async function getViewerEntrypoint(params: ProductHuntIntegrationOptions = {}) {
	return await getViewer(params)
}