transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.17k stars 5.24k forks source link

[Not functional] - Social images #437

Open RyRy79261 opened 1 year ago

RyRy79261 commented 1 year ago

Description

Social images are not being generated for any page and there is no insight into how these are controlled, set or generated outside of the get request in the code base

transitive-bullshit commented 1 year ago

They seem to be working on my end: https://transitivebullsh.it/api/social-image?id=b24073e8-4971-4172-aba8-d636448a69c3

The social image code is in an API edge function here: https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/main/pages/api/social-image.tsx

It's using the official @vercel/og package for generating social images on the fly.

This approach does have its downsides, though, so if it's not working for your deployment, we can try to figure out what's wrong. Are they working locally when you run the dev server?

Sai-Santosh-Pal commented 1 year ago

@transitive-bullshit I think the API isn't functioning well

RyRy79261 commented 1 year ago

@transitive-bullshit So I'm aware that its on the fly, however when I step through the code, its not receiving any data or generating anything, but it is loading the Notion page. Not sure what its meant to be loading into the social-image.tsx but yeah, cant get it to respond

sureshHARDIYA commented 1 year ago

I had same issue yesterday, I reduced some extra stuffs from that page like removed date, removed font, and reduced dimension of image and worked fine.

abhidadhaniya23 commented 10 months ago

I think image generation functionality working properly well and I was facing the problem of- Image generation for social media previews are working well in development (localhost) but in production I was getting unauthorized as response. I find a meaningful solution where I need to change the settings of vercel for this repository and here are the changes I made.

Please disable Vercel Authentication so that every time when you hit the end point, it'll return the generated image as response.

image