Skip to main content
Use Hacker news through Corsair: one client, typed API calls, optional local DB sync. What you get:
  • 16 typed API operations
  • 2 database entities synced for fast .search() / .list() queries

Setup

1

Install

pnpm install @corsair-dev/hackernews
2

Add the plugin

corsair.ts
import { createCorsair } from 'corsair';
import { hackernews } from '@corsair-dev/hackernews';

export const corsair = createCorsair({
	// ... other config options,
	multiTenancy: false,
    plugins: [hackernews()],
});
3

Get credentials

Follow Get Credentials if you need help getting keys.
4

Store credentials

pnpm corsair setup --plugin=hackernews
Use the key names documented in Get Credentials (for example api_key=, bot_token=, or OAuth client fields).

Authentication

Each tab shows how to register the plugin for that authentication method. The default authType from the plugin does not need to appear in the factory call.
corsair.ts
hackernews()
Store credentials with pnpm corsair setup --plugin=hackernews (see Get Credentials for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant.More: API Key

Query synced data

Synced entities support corsair.hackernews.db.<entity>.search() and .list(). See Database for filters and operators.

Example API calls

Read-style (read): items.get
await corsair.hackernews.api.items.get({});
Write-style (read): updates.get
await corsair.hackernews.api.updates.get({});
See the full list on the API page. Use pnpm corsair list --plugin=hackernews and pnpm corsair schema <path> locally to inspect schemas.

Hooks

Use hooks on API calls and webhookHooks on incoming events to add logging, approvals, or side effects. See Hooks and Webhooks for routing and payload patterns.

Reference

TopicLink
APIAPI
DatabaseDatabase
CredentialsGet credentials