LinkedIn post
Apply socialkit-social-core. Official API only. Setup: setup.
Rules
- Posts go to the personal profile; company pages need the Community Management API and options.organizationUrn.
- Link previews are not fetched: set options.title (and options.description) for link posts.
- The sign-in lasts 60 days and cannot be refreshed; sign in again when it expires.
Steps
- Sign in once:
node scripts/auth.mjs --platform linkedin --start, give the user thesignInUrl, thennode scripts/auth.mjs --platform linkedin --finish --url "<URL they landed on>". - Create the post folder with the socialkit-social-core post script:
node <socialkit-social-core>/scripts/post.mjs --init --dir li-<slug> --platform linkedin --kind <text|link|image|video> - Write
post.json(text, media with alt text, options). Seenode scripts/publish.mjs --help. - Validate:
node scripts/publish.mjs --check --dir li-<slug> - Stop. Show the post. Ask the user to approve in their own terminal:
node <socialkit-social-core>/scripts/post.mjs --approve --dir li-<slug> - Publish:
node scripts/publish.mjs --publish --dir li-<slug>and report the result.
Failure handling
LINKEDIN_401: sign in again.- Version errors: set LINKEDIN_VERSION to a current YYYYMM version.
APPROVAL_REQUIRED: the post changed after approval; ask again.ALREADY_PUBLISHED: this folder was posted; use--allow-repostonly if the user asks.
