← Public packages
@kentcdodds/linkedin
Headless helpers for LinkedIn identity, requests, and guarded posting using the saved linkedin OAuth integration.
src/create-text-post.ts
17 lines · 814 B · TypeScriptimport { createTextPost } from './client.ts'
import { parseCreateTextPostInput } from './create-text-post-input.ts'
/**
* Create or dry-run a personal-profile LinkedIn text post.
* Maps text aliases (`commentary` / `message` / `body`); rejects unknown keys.
* @param params.text - Post commentary text (aliases allowed).
* @returns Dry-run preview or published post metadata when `confirm: true`.
* @example
* import createTextPost from 'kody:@kentcdodds/linkedin/create-text-post'
* const result = await createTextPost({ text: 'Draft text', dryRun: true })
* // => { dryRun: true, body: { commentary: 'Draft text', ... } }
*/
export default async function createTextPostEntrypoint(params: Record<string, unknown> = {}) {
const input = parseCreateTextPostInput(params)
return createTextPost(input)
}