Skip to content

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

Package listing

@kentcdodds/producthunt

src/get-post.ts

14 lines · 521 B · TypeScript
import { getPost } from './domain.ts'
import type { ProductHuntGetPostOptions } from './types.ts'

/**
 * Look up a Product Hunt post by id or slug.
 * @param params.slug - Post slug such as `clara-ai-sdr`.
 * @example
 * import getPost from 'kody:@kentcdodds/producthunt/get-post'
 * const post = await getPost({ slug: 'clara-ai-sdr' })
 * // => { id: '...', name: 'Clara AI SDR', votesCount: 378 }
 */
export default async function getPostEntrypoint(params: ProductHuntGetPostOptions) {
	return await getPost(params)
}