Skip to content
← Public packages

@kody/personal-capture

Quick onboarding example: stash notes/links in packageStorage; list recent captures.

src/capture.ts

21 lines · 902 B · TypeScript
import { capture, type CaptureInput, type CaptureItem } from './index.ts'

/**
 * Stash a note (and optional URL) into this package's packageStorage.
 * Use when you want a zero-OAuth capture inbox; pass `notify: true` to email a confirmation.
 *
 * @param input.text - Note text to stash (required).
 * @param input.url - Optional related URL.
 * @param input.notify - When true, email yourself a short confirmation via kody.email_send.
 * @returns The stored capture `{ id, text, url, createdAt }`.
 *
 * @example
 * import capture from 'kody:@kody/personal-capture/capture'
 * const item = await capture({ text: 'Ship JSDoc fixes', url: 'https://kody.codes' })
 * // => { id: '...', text: 'Ship JSDoc fixes', url: 'https://kody.codes', createdAt: '...' }
 */
export default async function captureExport(input: CaptureInput): Promise<CaptureItem> {
	return await capture(input)
}

export { capture }