Skip to content
← Public packages

@kentcdodds/linkedin

Headless helpers for LinkedIn identity, requests, and guarded posting using the saved linkedin OAuth integration.

README.md

41 lines · 1.8 KB · Markdown

@kentcdodds/linkedin

Intent

Headless LinkedIn helpers for identity, API requests, and guarded personal-profile posting via the saved linkedin OAuth integration. Linked article posts should include explicit card metadata and an uploaded thumbnail, matching LinkedIn's API requirements instead of relying on unsupported URL scraping.

What it does

  • Verify the LinkedIn OAuth integration and read member profile / person URN
  • Call uncommon LinkedIn REST endpoints with saved token auth
  • Dry-run or publish personal-profile text, article, image, or video posts with explicit confirmation
  • Upload article thumbnails through the Images API before publishing link cards
  • Delete superseded posts by share or UGC post URN with explicit confirmation
  • Run the native video upload flow: register, upload parts, finalize, then post

Prerequisites / setup

  1. Connect the saved OAuth integration named linkedin (stores linkedinAccessToken / linkedinClientSecret — never paste values in chat).
  2. Ensure w_member_social scope for posting helpers.
  3. Reconnect at /connect/oauth?provider=linkedin when the token expires.
  4. Agents: see AGENTS.md for import paths and smoke checks.

There is no usable public LinkedIn OpenAPI for the full REST surface. This package uses a compact request helper that authenticates with createAuthenticatedFetch('linkedin') and injects LinkedIn protocol headers (LinkedIn-Version, X-Restli-Protocol-Version) for Rest.li endpoints.

Done when

  • OAuth integration linkedin is connected with posting scopes as needed
  • Smoke test verifies userinfo access without returning PII
  • Posting/upload helpers refuse to publish unless dryRun: true or confirm: true
  • Article posts pass explicit title, description, and thumbnail URN or thumbnailUrl (LinkedIn does not scrape Open Graph for API posts)