Skip to content
← Public packages

@danj/hey-email

HEY.com email for Kody: search threads, read messages, download PDF attachments, and write drafts. Sending is barred until you allow it.

src/index.js

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

/**
 * Smoke-test HEY auth and return the signed-in identity.
 * Use when verifying heyToken or as a cheap health check.
 *
 * @returns {Promise<{ id: number, name: string }>}
 *
 * @example
 * import identity from 'kody:@danj/hey-email'
 * const me = await identity()
 */
export default async function identity() {
  const data = await heyFetch('/identity')
  return { id: data.id, name: data.name }
}