Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/linkedin

src/create-video-post.ts

17 lines · 888 B · TypeScript
import { createVideoPost, requireRecord, requireStringField } from './client.ts'
import type { CreateVideoPostInput } from './client.ts'

/**
 * Create or dry-run a personal-profile LinkedIn video post.
 * @param params.videoUrn - Finalized `urn:li:video:...` URN, or use one-shot upload fields.
 * @returns Dry-run preview or published post metadata when `confirm: true`.
 * @example
 * import createVideoPost from 'kody:@kody/linkedin/create-video-post'
 * const result = await createVideoPost({ text: 'Draft video', videoUrn: 'urn:li:video:...', dryRun: true })
 * // => { dryRun: true, body: { ... } }
 */
export default async function createVideoPostEntrypoint(params: Partial<CreateVideoPostInput> & Record<string, unknown> = {}) {
  const input = requireRecord(params, 'create-video-post')
  requireStringField(input, 'text', 'create-video-post')
  return createVideoPost(input)
}