Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions apps/docs/content/guides/storage/s3/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ This is all the information you need to connect to Supabase Storage using any S3

<img alt="Storage S3 Access keys" src="/docs/img/storage/s3-credentials.png" width="100%" />

<Admonition type="note">

For optimal performance when uploading large files you should always use the direct storage hostname. This provides several performance enhancements that will greatly improve performance when uploading large files.

Instead of `https://project-id.supabase.co` use `https://project-id.storage.supabase.co`

</Admonition>

<Tabs
scrollable
size="small"
Expand All @@ -39,7 +47,7 @@ This is all the information you need to connect to Supabase Storage using any S3
const client = new S3Client({
forcePathStyle: true,
region: 'project_region',
endpoint: 'https://project_ref.supabase.co/storage/v1/s3',
endpoint: 'https://project_ref.storage.supabase.co/storage/v1/s3',
credentials: {
accessKeyId: 'your_access_key_id',
secretAccessKey: 'your_secret_access_key',
Expand All @@ -55,7 +63,7 @@ This is all the information you need to connect to Supabase Storage using any S3
[supabase]
aws_access_key_id = your_access_key_id
aws_secret_access_key = your_secret_access_key
endpoint_url = https://project_ref.supabase.co/storage/v1/s3
endpoint_url = https://project_ref.storage.supabase.co/storage/v1/s3
region = project_region
```
</TabPanel>
Expand Down Expand Up @@ -86,7 +94,7 @@ const {
const client = new S3Client({
forcePathStyle: true,
region: 'project_region',
endpoint: 'https://project_ref.supabase.co/storage/v1/s3',
endpoint: 'https://project_ref.storage.supabase.co/storage/v1/s3',
credentials: {
accessKeyId: 'project_ref',
secretAccessKey: 'anonKey',
Expand Down
16 changes: 13 additions & 3 deletions apps/docs/content/guides/storage/uploads/resumable-uploads.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ The resumable upload method is recommended when:

Supabase Storage implements the [TUS protocol](https://tus.io/) to enable resumable uploads. TUS stands for The Upload Server and is an open protocol for supporting resumable uploads. The protocol allows the upload process to be resumed from where it left off in case of interruptions. This method can be implemented using the [`tus-js-client`](https://github.com/tus/tus-js-client) library, or other client-side libraries like [Uppy](https://uppy.io/docs/tus/) that support the TUS protocol.

<Admonition type="note">

For optimal performance when uploading large files you should always use the direct storage hostname. This provides several performance enhancements that will greatly improve performance when uploading large files.

Instead of `https://project-id.supabase.co` use `https://project-id.storage.supabase.co`

</Admonition>

<Tabs
scrollable
size="small"
Expand All @@ -35,7 +43,8 @@ Supabase Storage implements the [TUS protocol](https://tus.io/) to enable resuma

return new Promise((resolve, reject) => {
var upload = new tus.Upload(file, {
endpoint: `https://${projectId}.supabase.co/storage/v1/upload/resumable`,
// Supabase TUS endpoint (with direct storage hostname)
endpoint: `https://${projectId}.storage.supabase.co/storage/v1/upload/resumable`,
retryDelays: [0, 3000, 5000, 10000, 20000],
headers: {
authorization: `Bearer ${session.access_token}`,
Expand Down Expand Up @@ -125,7 +134,7 @@ Supabase Storage implements the [TUS protocol](https://tus.io/) to enable resuma
// Initialize Uppy instance only once
const [uppy] = useState(() => new Uppy());
// Initialize Supabase client with project URL and anon key
const supabase = createClient(projectURL, anonKey);
const supabase = createClient(`https://${projectId}.supabase.co`, anonKey);

useEffect(() => {
const initializeUppy = async () => {
Expand All @@ -135,7 +144,8 @@ Supabase Storage implements the [TUS protocol](https://tus.io/) to enable resuma
} = await supabase.auth.getSession();

uppy.use(Tus, {
endpoint: `${projectURL}/storage/v1/upload/resumable`, // Supabase TUS endpoint
// Supabase TUS endpoint (with direct storage hostname)
endpoint: `https://${projectId}.storage.supabase.co/storage/v1/upload/resumable`,
retryDelays: [0, 3000, 5000, 10000, 20000], // Retry delays for resumable uploads
headers: {
authorization: `Bearer ${session?.access_token}`, // User session access token
Expand Down
Loading