5
2 Comments

Dynamically Rendering Social Sharing Images

After getting inspired by dynamically generated social sharing images that I've seen on IndieHackers, I decided to roll-up my sleeves ship this feature for Fizbuz. Here's a quick recap of what I had to build:

  1. I created a screenshot API that accepts a URL and uses chrome-aws-lambda & puppeteer to capture a screenshot and store it in S3.

  2. I created a special webpage to render a tl;dr version of a user's Fizbuz profile. This is the webpage that the screenshot API will request. Here's an example: https://fizbuz.com/u/carter/share

  3. When a Fizbuz user updates their profile, I invoke the /screenshot API:

await fetch(`/screenshot/${user.nickname}/share`)
  1. When someone shares a Fizbuz profile URL on a social platform, there are meta tags in the header that point at the preview image that was stored in S3:
<meta property="og:image" content="${imageUrl}" />
<meta name="twitter:image" content="${imageUrl}" /> 

That's it! ✨

https://fizbuz.com/u/carter

, Founder of Icon for Fizbuz
Fizbuz
on May 27, 2019
  1. 1

    Awesome feature. I really like dynamic previews. Do you measure impact of this feature on traffic acquired from social media platforms?

    1. 1

      Not yet. Honestly, a lot of my product roadmap includes best practices that I'm observing or learning about on other SaaS products.

Trending on Indie Hackers
What happened after my AI contract tool post got 70+ comments User Avatar 213 comments $36K in 7 days: Why distribution beats product (early on) User Avatar 96 comments Where is your revenue quietly disappearing? User Avatar 87 comments I've been reading 50 indie builder posts a day for the past month. Here's the pattern nobody talks about. User Avatar 82 comments We made Android 10x faster. Now, we’re doing it for the Web. 🚀 User Avatar 71 comments a16z says "these startups don't exist yet - it's your time to build." I've been building one. User Avatar 57 comments