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/like-post.ts

14 lines · 629 B · TypeScript
import { likePost } from './client.ts'
import type { XPostActionParams } from './client.ts'

/**
 * Like or dry-run liking an X post. Maps postId aliases (tweetId/statusId/url); rejects unknown keys. Requires confirm: true to execute.
 * @returns Like result, or dry-run action payload.
 * @example
 * import likePost from 'kody:@kentcdodds/x/like-post'
 * const preview = await likePost({ postId: '123', dryRun: true })
 * // => { dryRun: true, action: 'like-post', requiresConfirm: true, payload: { ... } }
 */
export default async function likePostEntrypoint(params: XPostActionParams = {}) {
	return await likePost(params)
}