Skip to content

Kody is live

Watch the launch video — what Kody is, and why it exists.

← Public packages

@noah/hey-email

HEY.com email integration with Kody: search threads, read messages/attachments, create drafts, and send with explicit confirmation.

src/boxes.js

16 lines · 434 B · JavaScript
import { heyFetch } from './client.js'

/**
 * List HEY boxes (Imbox, Feed, etc).
 * Use when you need box ids/kinds before reading a mailbox.
 *
 * @returns {Promise<unknown[]>}
 *
 * @example
 * import listBoxes from 'kody:@noah/hey-email/boxes'
 * const boxes = await listBoxes()
 */
export default async function listBoxes() {
  const data = await heyFetch('/boxes.json')
  return Array.isArray(data) ? data : data?.boxes || []
}