Twitter card does not render

I want to share a page of my redwoodsjs App on Twitter, but the Twitter card does not render. Can anybody help with this? Do I have to use SSR to get it work?

Thanks

Hi.

This is a known behavior of all SPAs. This isn’t a limitation of RedwoodJS.

Twitter and other sites that request a page look for the meta open graph tags — but they only render after the JavaScript renders. That means when it looks for the og image url … it’s not there yet.

To get the behavior where the page can provide the meta tags you’ll need a service like Netlify pre-rendering Prerendering | Netlify Docs

I use this all the time and it works great.

I also use this to dynamically generate og images using Netlify edge functions here redwood-office-hours/README.md at main · redwoodjs/redwood-office-hours · GitHub

There is an RFC to design a solution to render the SEO head items for this use case

If your page isn’t dynamic, then you can also use RedwoodJS pre-rendering for the meta tags to appear.

But if your page sets the tags bass on a cell query, then your need a pre-rendering service as shown above.