Generate R2 Objecs Public URL

I would like to retrieve the public url once the upload is completed, but I am getting a url with some headers X-Amz-Date and like those, I want to list my pdfs to my public website.
   // Generate a public URL for the uploaded file
        const publicUrl = r2.getSignedUrl('getObject', {
            Bucket: process.env.R2_BUCKET,
            Key: fileName,
        });

Correct me if that's okay to use such url and expose to public.
Was this page helpful?