> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postqueen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn setup

> Register the LinkedIn application and give PostQueen its keys

On your own instance the LinkedIn app is yours: create it on LinkedIn Developers, then put its client id and secret in your environment.

<Steps>
  <Step title="Create a new app">
    Head over to [LinkedIn developers](https://www.linkedin.com/developers/apps) and create a new app.

    <Frame>
      <img src="https://mintcdn.com/forceplay/Gsgj4WOu3HFxkte6/images/providers/linkedin/linkedin-001.png?fit=max&auto=format&n=Gsgj4WOu3HFxkte6&q=85&s=f97cfedf8d4568917bed282b0191efe7" alt="LinkedIn" width="2366" height="676" data-path="images/providers/linkedin/linkedin-001.png" />
    </Frame>
  </Step>

  <Step title="Add required products">
    Fill in all the details, then head over to **Products** and add all three:

    * Share on LinkedIn
    * Advertising API
    * Sign in with LinkedIn using OpenID connect

    <Frame>
      <img src="https://mintcdn.com/forceplay/Gsgj4WOu3HFxkte6/images/providers/linkedin/linkedin-002.png?fit=max&auto=format&n=Gsgj4WOu3HFxkte6&q=85&s=9e7c8e81929e494d41a52e1f1ee06434" alt="LinkedIn" width="2436" height="1356" data-path="images/providers/linkedin/linkedin-002.png" />
    </Frame>

    Those three together grant the seven scopes PostQueen asks for, and the connect is refused if
    any of them is missing:

    ```
    openid
    profile
    w_member_social
    r_basicprofile
    rw_organization_admin
    w_organization_social
    r_organization_social
    ```

    <Warning>
      Request the Advertising API permissions and fill in its request form, or you will not be able
      to refresh your tokens. That one is easy to skip because everything appears to work until the
      first token expires.
    </Warning>
  </Step>

  <Step title="Configure OAuth2 Redirect URI">
    <Snippet file="oauth2redirect.mdx" />

    **Your LinkedIn OAuth2 Redirect URI:**

    * Production: `https://postqueen.example.com/integrations/social/linkedin`
    * Local development: `http://localhost:4200/integrations/social/linkedin`
    * Docker: `http://localhost:4007/integrations/social/linkedin`

    <Note>
      If you are using the "LinkedIn Page" provider, replace `linkedin` with `linkedin-page` in the redirect URI.
    </Note>
  </Step>

  <Step title="Copy your credentials">
    Copy the created `Client ID` and `Client Secret` and add them to your `.env` file.

    ```env theme={"system"}
    LINKEDIN_CLIENT_ID=""
    LINKEDIN_CLIENT_SECRET=""
    ```

    You can find those under the Auth Tab of your LinkedIn App in the developer portal.
  </Step>

  <Step title="Restart and add the LinkedIn channel">
    <Snippet file="restart-and-add-channel.mdx" />
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="What she can post to LinkedIn" icon="https://mintcdn.com/forceplay/LL5FipRv-7nhg1To/images/channels/linkedin.svg?fit=max&auto=format&n=LL5FipRv-7nhg1To&q=85&s=2c2628c534738a636d32d735d006b3cb" href="/providers/linkedin" width="64" height="64" data-path="images/channels/linkedin.svg">
    Limits, post types and settings
  </Card>

  <Card title="Configuration reference" icon="list" href="/configuration/reference">
    Every variable she reads
  </Card>

  <Card title="Connect errors" icon="plug-circle-xmark" href="/troubleshooting/oauth-connect">
    Invalid state, invalid\_grant and the rest
  </Card>

  <Card title="Another channel" icon="plug" href="/providers/overview">
    Every network, and what each one asks for
  </Card>
</CardGroup>
