Hi guys, I've been trying to parse and create a link preview for API generated presentations from the url - for two days now - and feel completely stuck. I can't get the actual link preview like link previews for socials can. Can anyone help me for a workaround or with some ideas? Image: my sad generic link preview card. Happy I've found this slack. Awesome work Gamma is doing. It will help our teachers a lot, once I get this API going.
Hi Tom 👋 Thank you for bringing this to our attention! I am conferring with our engineering team and will follow up with you when I have more details to share.
Thanks! That's great to hear. Meanwhile I'm trying to do it via the embed link, since that does seem to draw html. The regular presentation link doesn't.
Hi Tom can you share the link to the Gamma you're trying to share? What sharing settings do you have assigned for that doc? What platform are you trying to share it on? (Linkedin, Whatsapp etc). This will help me figure out if its an issue with Opengraph standard or something else.
Here you go: https://gamma.app/docs/mvx7aldnr4ahb8z I'm trying to generate a link preview for our own react AI app where we use your api for a presentation create toolcall.
Sharing is as open as possible, so the user who made the request can edit it.
I think it could be an issue with the opengraph standard, judging from this quick check: https://www.opengraph.xyz/url/https%3A%2F%2Fgamma.app%2Fdocs%2Fmvx7aldnr4ahb8z
Got it, so you're building a React app where users trigger Gamma presentations through the API, and you want those presentation links to generate proper previews when shared within your app. I can see from that OpenGraph check that the metadata isn't rendering for your generated presentation. That's definitely worth looking into. Before I dig deeper with the team, can you help me understand the full picture a bit more? When you say you're trying to generate link previews in your React app, are you using a specific library for that, or building something custom? And have you tried sharing one of these links on any other platforms (like Slack or LinkedIn) to see if the preview issue is specific to your app's implementation or if it's happening everywhere? I'm asking because this could be a couple of different things - it might be specific to how API-generated content handles OpenGraph metadata, or it could be something broader with how Gamma presentations generate previews in general. If you've tested on other platforms and seeing the same thing, that'll help me narrow down where the issue actually is.
Hey Tom I actually got some more helpful context from the team: Gamma's link preview system is designed to work with social platforms like LinkedIn, Slack, or Twitter. Those platforms send specialized bots to fetch preview metadata, and that's when we serve up the preview images and description. For instance if I try to post your Gamma in Linkedin I see it unfurl correctly: Since you're building a custom React app, the previews won't generate the same way because your app is fetching the links differently than those social platform bots do. This is actually product-wide behavior, not specific to API-generated content - it would be the same issue with any Gamma link in a custom preview implementation. Building link preview systems that work across different types of content is pretty complex and falls outside what we can help with directly. You might want to look into existing link preview services or libraries that already handle the crawler behavior that social platforms use. Does the embed link approach you mentioned earlier work better for what you're trying to build?
What I've already tried:
scraping the html
scraping for og tags
using a cloud function with link-preview-js,
using a headless browser in a cloud service (puppeteer and some others),
emulating the twitterbot
scraping the embed page for the html title
Every time I only get the same generic metadata or nothing. Anyway, thanks for investingating. If it's out of scope for what you'd be willing to help with, that would be quite sad news to me. I hoped the issue with Open Graph was not intended. I've been trying to emulate the twitter bot, but it is quite difficult and my expertise (nor cursor AI's) can crack it.
My assumption was that, releasing the API, Gamma was also supportive of other apps implementing Gamma's generative service into their products.
In that usecase, I'd think previewing links through Open Graph would be a regular need. Two questions remain:
Is Open Graph something you're planning to support in the future?
Could you steer me in the right direction, given that exactly emulating these social bots seems inaccessible to me? I've followed countless of guides but none make the content unfurl like it does for these socials.
Thanks for the help and timely responses so far.
Anyone here that has experience with fetching link previews when Open Graph is not working?
I really appreciate you sharing all the different approaches you've tried. That's genuinely helpful context and shows you've done your homework on this. To answer your questions directly: I don't have any timeline to share on OpenGraph support changes, but I'm flagging this use case with the product team because you're not the first person building an integration who's hit this. Your point about link previews being a regular need for apps implementing Gamma makes total sense. On steering you in the right direction for emulating the social bots - that's unfortunately where I hit the limit of what I can help with. The crawler emulation piece is complex enough that it falls outside what we can troubleshoot in API support. I wish I had a better answer there. The link preview behavior you're running into is how the product works across the board right now, not something specific to API-generated content. The embed link approach you mentioned trying earlier might be your best path forward for now, even though I know it's not the ideal solution you were hoping for. If you've already explored that route and it's not working either, let me know what you're running into with it. Really glad to hear Gamma's helping your teachers. Keep the feedback coming as you build with the API - it genuinely helps shape where things go.
Thanks for the responses. I appreciate the thoughtful explanation. The embed link seemed to be a dead end so far. Can't seem to scrape the HTML. Maybe I'll try again tomorrow. For now, I'll see if I can find a workaround.
.png)