nextjs-notion-starter-kit
nextjs-notion-starter-kit copied to clipboard
[Not functional] - Social images
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
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?
@transitive-bullshit I think the API isn't functioning well
@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
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.
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.