AI
Pass

Build an AI LinkedIn Post Generator with AI Pass SDK

Build an AI LinkedIn Post Generator with AI Pass SDK

LinkedIn has become the go-to platform for professional content — and the demand for tools that help people write better posts is massive. Here's how to build a LinkedIn post generator using the AI Pass SDK.

What You'll Build

Users describe what they want to post about (achievement, insight, story, announcement), pick a tone, and get a polished LinkedIn post ready to copy and paste.

Step 1: Get Your Client ID

  1. Sign up at aipass.one
  2. Go to Developer DashboardOAuth2 Clients
  3. Create a new client → copy your YOUR_CLIENT_ID

Step 2: Build the App

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>AI LinkedIn Post Generator</title>
  <script src="https://aipass.one/aipass-sdk.js"></script>
  <style>
    body { font-family: sans-serif; max-width: 700px; margin: 40px auto; padding: 20px; }
    select, input, textarea { width: 100%; margin: 8px 0 16px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
    button { background: #0a66c2; color: white; padding: 12px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; }
    #output { background: #f3f2ef; padding: 20px; border-radius: 12px; margin-top: 20px; white-space: pre-wrap; line-height: 1.7; }
    .copy-btn { background: #fff; border: 1px solid #0a66c2; color: #0a66c2; padding: 8px 16px; border-radius: 6px; cursor: pointer; margin-top: 10px; }
  </style>
</head>
<body>
  <h1>💼 AI LinkedIn Post Generator</h1>
  
  <label>What do you want to post about?</label>
  <textarea id="topic" rows="3" placeholder="e.g. I just landed my first client after 3 months of cold outreach. Here's what I learned..."></textarea>
  
  <label>Post Type</label>
  <select id="postType">
    <option value="personal_story">Personal Story — Share an experience or lesson</option>
    <option value="thought_leadership">Thought Leadership — Share an insight or opinion</option>
    <option value="achievement">Achievement — Celebrate a win professionally</option>
    <option value="tips_list">Tips List — Share actionable advice</option>
    <option value="industry_commentary">Industry Commentary — Comment on a trend</option>
    <option value="announcement">Announcement — New role, project, or launch</option>
  </select>
  
  <label>Tone</label>
  <select id="tone">
    <option value="professional and engaging">Professional & Engaging</option>
    <option value="conversational and relatable">Conversational & Relatable</option>
    <option value="bold and direct">Bold & Direct</option>
    <option value="storytelling and vulnerable">Storytelling & Authentic</option>
    <option value="inspirational and motivating">Inspirational & Motivating</option>
  </select>
  
  <label>Target Audience</label>
  <input type="text" id="audience" placeholder="e.g. startup founders, HR professionals, software developers..." />
  
  <button onclick="generatePost()">Generate LinkedIn Post 🚀</button>
  <div id="output"></div>
  <button class="copy-btn" id="copyBtn" onclick="copyPost()" style="display:none">Copy Post</button>

  <script>
    AiPass.initialize({
      clientId: 'YOUR_CLIENT_ID',
      requireLogin: true,
      darkMode: false
    });

    async function generatePost() {
      const topic = document.getElementById('topic').value;
      const postType = document.getElementById('postType').value;
      const tone = document.getElementById('tone').value;
      const audience = document.getElementById('audience').value;

      if (!topic) { alert('Please describe what you want to post about'); return; }

      document.getElementById('output').textContent = 'Writing your post...';

      const postTypeGuides = {
        personal_story: 'Start with a hook sentence that creates curiosity. Then tell the story. End with a lesson or insight. Ask a question at the end.',
        thought_leadership: 'Start with a bold, counterintuitive statement. Support with 3 specific points. End with your take and invite discussion.',
        achievement: 'Be humble and grateful. Share the journey not just the win. Credit others. Make it relatable, not boastful.',
        tips_list: 'Start with the value proposition. Use numbered list format (1. 2. 3.). Keep each tip short. End with a CTA to save the post.',
        industry_commentary: 'Name the trend clearly. Give your unique perspective. Back with an observation or data. Invite others to share their view.',
        announcement: 'Lead with excitement. Explain what it is and why it matters to your network. Thank relevant people. Link or CTA.'
      };

      const result = await AiPass.generateCompletion({
        model: 'gpt-5-mini',
        temperature: 1,
        max_tokens: 16000,
        messages: [
          {
            role: 'system',
            content: `You are an expert LinkedIn content strategist who understands what makes posts go viral on LinkedIn. You write posts that feel authentic, not promotional. ${postTypeGuides[postType]}`
          },
          {
            role: 'user',
            content: `Write a LinkedIn post about: "${topic}"

Post type: ${postType.replace(/_/g, ' ')}
Tone: ${tone}
Target audience: ${audience || 'professionals generally'}

Requirements:
- Start with a strong hook (first line must make people stop scrolling)
- Use line breaks frequently (LinkedIn rewards easy-to-read formatting)
- Include emojis sparingly (1-3 max, only where they add value)
- End with either a question to drive comments OR a clear CTA
- 150-300 words is ideal
- Add 3-5 relevant hashtags at the end

Write the complete post, ready to copy-paste:`
          }
        ]
      });

      const postText = result.choices[0].message.content;
      document.getElementById('output').textContent = postText;
      document.getElementById('copyBtn').style.display = 'inline-block';
    }

    function copyPost() {
      navigator.clipboard.writeText(document.getElementById('output').textContent);
      document.getElementById('copyBtn').textContent = 'Copied! ✓';
      setTimeout(() => document.getElementById('copyBtn').textContent = 'Copy Post', 2000);
    }
  </script>
</body>
</html>

Deploy

Self-host: Single static HTML file — GitHub Pages, Netlify, anywhere.

AI Pass Catalog: Publish via Developer Dashboard → earn 50% commission on every post generated. LinkedIn post tools get high repeat usage.

Embed It

The </> button at the bottom-right of your published app gives you an iframe snippet — add it to any blog, career coaching site, or personal brand website.

Try the live app: aipass.one/apps/linkedin-post-gen

Related apps: