Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Conversation

@dshukertjr
Copy link
Member

@dshukertjr dshukertjr commented May 31, 2021

What kind of change does this PR introduce?

Introducing a new feature to add a method to easily retrieve public URLs of object uploaded to storage.

Related PR on storage-api
supabase/storage#19

What is the current behavior?

There is not an easy way of getting a public URL of an object.

What is the new behavior?

There will be a method where you can just pass the bucket and the path, and it will return full URL of the object.

Additional context

I don't know if we need a method like this when all it is doing is just concatenating Supabase URL, bucket name, and path with '/object/public' in the middle, but personally I would appreciate if the SDK could handle the concatenation.

Also, I was not sure if implementing something like this has been discussed internally, so if there is already a plan for it, and is different from the code that I wrote, please feel free to just close this PR.

Otherwise, any feedback is greatly appreciated!

@dshukertjr dshukertjr changed the title Added a method to get public URL of an object into StorageFileApi.ts Added a method to get public URL of an object May 31, 2021
@dshukertjr
Copy link
Member Author

Was going to add tests, but did not find any object related tests, so left it for now. If someone could direct me, that will be great!

@dshukertjr dshukertjr marked this pull request as draft May 31, 2021 05:23
@dshukertjr dshukertjr marked this pull request as ready for review May 31, 2021 05:29
@inian
Copy link
Member

inian commented May 31, 2021

This is amazing Tyler! I was planning on adding this, but really appreciate the contribution :)

I will leave this open since old projects need to be updated to storage-api 0.3.0 for this to work for them. This will be done in a day or two.

@dshukertjr
Copy link
Member Author

Sounds fantastic @inian !

@dshukertjr dshukertjr changed the title Added a method to get public URL of an object feat: Added a method to get public URL of an object May 31, 2021
@inian inian merged commit 0d7e58c into supabase:main Jun 2, 2021
@kiwicopple
Copy link
Member

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants