NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.69k stars 544 forks source link

How do I display private notion images? #529

Open marcuspapin opened 8 months ago

marcuspapin commented 8 months ago

Description

Hello, I have a private Notion page that I am successfully able to display, however, I am unable to display the private images on that page (I can display public images).

I am using the preview Images code from the starter to generate preview images.

This is the error that I am getting when I try to retrieve the private images:

{"errorId":"881dc246-e21a-4011-b9aa-fd967b769a1b","name":"ValidationError","debugMessage":"User does not have access.","message":"Something went wrong. (400)"}

Do I have to pass in user credentials somewhere when I am trying to retrieve the private images?

Please let me know if you need any additional information - I did not include the page ID, as it is a private page.

Thank you!

xiaolongkipsi commented 8 months ago

I feel like this is the problem and we are not generating signed url since notion changed the url pattern https://github.com/NotionX/react-notion-x/blob/master/packages/notion-client/src/notion-api.ts#L237C41-L237C41