最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - SSR in Vite for dynamic whatsapp og:image - Stack Overflow

programmeradmin2浏览0评论

I'm working on a project made on Vite, now there is this Product card and when I click on it, it redirects to a Product Detail component where an API is hit to fetch the data of that product, and I'm getting the id from url params.

Now i have this requirement that when the product detail page is shared on whatsapp, the image incoming from the api data should be displayed as a preview image.

I'm also using react-helmet async, and providing the image url to it but it is not working as whatsapp crawlers dont execute javascript.

Can I somehow pre-render the html in vite with the image incoming from API data? something like SSR or SSG? At this point, it's too late to switch to Next js or some other framework. I just want to send the image along with the page url in whatsapp, tried sending separate image as a single message as well but that didnt work as well.

Please help me as I want to get it done with this project, this is currently the last concern. Thank you

发布评论

评论列表(0)

  1. 暂无评论