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
1 small portfolio change got me 10x more impressions User Avatar 30 comments AI Is Destroying the Traditional Music Business and Here’s Why. User Avatar 28 comments Fixing my sleep using public humiliation and giving away a Kindle User Avatar 23 comments A Tiny Side Project That Just Crossed 100 Users — And Somehow Feels Even More Real Now User Avatar 16 comments From 1k to 12k visits: all it took was one move. User Avatar 11 comments Tell me what your business does, I’ll show you the growth loops you’re probably missing. User Avatar 10 comments