Skip to content
← Public packages

@kentcdodds/x

X API v2 helpers for tweets, search, legacy DMs, and encrypted X Chat via a Fly XDK sidecar.

src/get-me.ts

15 lines · 582 B · TypeScript
import { getMe } from './client.ts'
import type { XGetMeParams } from './client.ts'

/**
 * Reads the authenticated X user with OAuth user-context auth.
 * Pass `account: '<purpose>'` for integration `x-<purpose>` (default omit → `x`).
 * @returns X API user payload from GET /users/me.
 * @example
 * import getMe from 'kody:@kentcdodds/x/get-me'
 * const me = await getMe({ account: 'kodykoala' })
 * // => { data: { id: '...', username: 'kodykoala', name: 'Kody' } }
 */
export default async function getMeEntrypoint(params: XGetMeParams = {}) {
  return await getMe(params)
}