# Post to LinkedIn Personal Profile

**URL:** <https://community.crewai.com/t/post-to-linkedin-personal-profile/2560>\
**Category:** General\
**Tags:** tool\
**Created:** [January 7, 2025, 6:08pm UTC](https://community.crewai.com/t/post-to-linkedin-personal-profile/2560 "2025-01-07T18:08:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eacee](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@eacee](https://community.crewai.com/u/eacee)\
**Post date:** [January 7, 2025, 6:08pm UTC](https://community.crewai.com/t/post-to-linkedin-personal-profile/2560/1 "2025-01-07T18:08:36Z")

</div>

Has anyone created a custom tool that will post to your personal LinkedIn profile? If so, could you point me to a repo or documentation?

Thx,  
Ed

---

<div class="post-metadata">

**Author:** ![eacee](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@eacee](https://community.crewai.com/u/eacee)\
**Post date:** [January 15, 2025, 6:00pm UTC](https://community.crewai.com/t/post-to-linkedin-personal-profile/2560/2 "2025-01-15T18:00:07Z")

</div>

Found a potential solution:  
{ [langchain-ai/social-media-agent](https://github.com/langchain-ai/social-media-agent?tab=readme-ov-file#setup-linkedin-authentication)}

### Setup LinkedIn authentication:

To authorize posting on LinkedIn, you’ll need to:

1. Create a new LinkedIn developer account, and app [here](https://developer.linkedin.com/)
2. After creating your app, navigate to the `Auth` tab, and add a new authorized redirect URL for OAuth 2.0. Set it to `http://localhost:3000/auth/linkedin/callback`
3. Go to the `Products` tab and enable the `Share on LinkedIn` and `Sign In with LinkedIn using OpenID Connect` products.

If you plan on posting from company pages, you’ll need to do the following:

1. ``

- ``
- ``
- ``

1. ` `
2. ` ` ``
3. ` ` ``

> ` ` ` ` ` ` ``
> 
> ``

1. Save the following environment variables in your `.env` file:

- `LINKEDIN_CLIENT_ID`
- `LINKEDIN_CLIENT_SECRET`

1. Run the `yarn start:auth` command to run the LinkedIn OAuth server. Open [http://localhost:3000](http://localhost:3000/) in your browser, and click `Login with LinkedIn`.
2. After logging in, copy the `access_token` and `sub` values from the objects logged to the terminal. Set these values as `LINKEDIN_ACCESS_TOKEN` (`access_token`) and `LINKEDIN_PERSON_URN` (`sub`) in your `.env` file.

After setting up LinkedIn, set the `LINKEDIN_USER_ID` environment variable to the user ID of the account that you want to use to post to LinkedIn. (e.g `LINKEDIN_USER_ID="your_linkedin_email_address@example.com"`)
