LinkedIn posting uses an OAuth access token and a member or organization identity.
Content support
| Capability | Support |
|---|---|
| Text | Up to 3000 characters. |
| Images | Up to 9 images. |
| Video | One video. |
| Mixed media | Not supported. |
| Empty posts | Not allowed; provide text or media. |
Set up credentials
- Create a LinkedIn app in the LinkedIn Developer portal.
- Request the products and permissions needed for posting (
w_member_social, plusopenid,profile,emailif you need login data). - Configure OAuth redirect URIs for your app or Scheduler deployment.
- Run the OAuth authorization flow.
- Store the access token and member ID or page/organization ID.
- Confirm the token has posting permissions before using it in automation.
The CLI does not bundle a LinkedIn OAuth app. To use it from the CLI, supply your own client secret through SIMPLE_POST_LINKEDIN_CLIENT_SECRET before running simplepost account add linkedin.
Environment variables
LINKEDIN_ACCESS_TOKEN=
LINKEDIN_MEMBER_ID=
Both variables must be set together.
SDK options
await post({
content: {
text: "Posting to LinkedIn",
media: [{ type: "image", path: "./photo.jpg" }],
},
platforms: ["linkedin"],
options: {
linkedin: {
visibility: "PUBLIC",
},
},
});
visibility can be:
PUBLICCONNECTIONS
REST server account
Add this entry under accounts in the self-hosted REST server's accounts.json:
{
"id": "linkedin-page",
"platform": "linkedin",
"credentials": {
"accessToken": "...",
"memberId": "..."
},
"options": {
"visibility": "PUBLIC"
}
}