Skip to content

README.md

41 lines · 1.7 KB · Markdown

@kentcdodds/producthunt

Intent

Give Kody agents a reusable Product Hunt helpers surface: one generic GraphQL request util plus common read helpers for posts, hunters, topics, collections, and comments. The saved producthunt OAuth integration is credentials only; this package is how agents should call Product Hunt.

What it does

  • List featured or filtered hunts; look up a post, hunter, topic, or collection
  • Read comments on a post
  • Return the connected hunter (viewer.user) when private scope is granted
  • Call any Product Hunt GraphQL operation (including mutations) through request
  • Verify the saved OAuth integration with a read-only smoke test

Read helpers only for the common paths. Page sizes are clamped to 1–20 to match the Product Hunt API. Use request for uncommon queries or mutations.

Prerequisites / setup

  1. Create a Confidential Product Hunt OAuth app at api.producthunt.com/v2/oauth/applications.
  2. Redirect URI: https://kody.codes/connect/oauth (or your Kody origin plus /connect/oauth).
  3. Connect with public and private scopes (use the guide export for the connect URL). Saved OAuth integration name: producthunt.
  4. Approve host: api.producthunt.com.
  5. Agents: see AGENTS.md for import paths, smoke, and edge cases.

Public scope is enough for featured posts. Private scope is required for viewer.user. Write mutations need Product Hunt app approval and the write scope.

Done when

  • The producthunt OAuth integration is connected (public + private)
  • Host api.producthunt.com is approved
  • Smoke test returns { ok: true } with viewer + a featured post sample