Skip to content

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

Package listing

@kody/reddit

src/accounts.ts

17 lines · 689 B · TypeScript
import { accounts } from './client.ts'

/**
 * Resolve which Reddit OAuth integration to use.
 * - `integration` wins when set (exact integration name, e.g. `reddit-work`)
 * - `account: 'work'` → `reddit-work` (Kody `<provider>-<purpose>` convention)
 * - `account: 'default'` / `'reddit'` / omitted → `reddit`
 * @example
 * import accounts from 'kody:@kody/reddit/accounts'
 * const resolved = await accounts({ account: 'work' })
 * // => { integration: 'reddit-work', connectUrl: 'https://kody.codes/connect/oauth?provider=reddit-work' }
 */
export default async function accountsEntrypoint(
	params: { integration?: string; account?: string } = {},
) {
	return accounts(params)
}