Skip to content

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

Package listing

@kody/linkedin

src/register-video-upload.ts

16 lines · 833 B · TypeScript
import { registerVideoUpload, requireRecord } from './client.ts'
import type { RegisterVideoUploadInput } from './client.ts'

/**
 * Initialize a native LinkedIn video upload and return upload instructions.
 * @param params.fileSizeBytes - Total video size in bytes.
 * @returns Upload instructions or dry-run payload when `confirm` is omitted.
 * @example
 * import registerVideoUpload from 'kody:@kody/linkedin/register-video-upload'
 * const result = await registerVideoUpload({ fileSizeBytes: 1048576, dryRun: true })
 * // => { dryRun: true, body: { initializeUploadRequest: { ... } } }
 */
export default async function registerVideoUploadEntrypoint(params: Partial<RegisterVideoUploadInput> & Record<string, unknown> = {}) {
  const input = requireRecord(params, 'register-video-upload')
  return registerVideoUpload(input)
}