Skip to content

Signed Urls Images not being display #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
reneleyva opened this issue Apr 24, 2025 · 4 comments
Open

Signed Urls Images not being display #626

reneleyva opened this issue Apr 24, 2025 · 4 comments

Comments

@reneleyva
Copy link

I'm using V7.3.0.

Our react page use to work just fine but at some point the images disappear. After investigating it appear to be a redirect to a CDN instead of getting the signed url the first time. The src url we're getting starts with https://www.notion.so/image/attachment... but if you open it in the browser it does a redirect to https://img.notionusercontent.com/s3/prod-files... and that one is accesible. I see in the recordMap that a signed_urls field exists. I'm wondering if I have to do something with it or a add a special prop to the NotionRenderer component. Thanks!

@reneleyva reneleyva changed the title Private Images not being display after a redirect. Signed Urls Images not being display Apr 24, 2025
@aeciolevy
Copy link

I've encountered the same issue.

Previously, whatever the notion-client returned for a page would render images without any problems.

As @reneleyva mentioned, this hasn't worked for the past two weeks.

I have also updated to the latest version, v7.3.

I'm using it for private pages.

Everything else seems to be working fine, but images are not.

@transitive-bullshit
Copy link
Member

is there a PR that fixes this? if so, i'm happy to merge & push a release

@aeciolevy
Copy link

@transitive-bullshit
I think the fix would be more on the notion-client package side.

The imageUrl returned when we copy and paste into another tab follows a redirect to a signedUrl.

If you can give me a general idea or best practice, I can draft a PR soon.
From what I see, my approach would be:

  • Gather all the imageUrls
  • Make a GET request for each to retrieve the corresponding signedUrl
  • Replace all imageUrls with their signedUrl counterparts

What do you think of this approach?

@reneleyva
Copy link
Author

@aeciolevy The client response already includes a signed_urls field. Is a Map between the blockIds and images link. I see a PR that is related to this #613 which is included in v7.3. But those links are also private, and needs an authenticated user to access it. I see that in all the library examples the images are public, but this is not mentioned in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants