Skip to content

Commit 1809b1d

Browse files
authored
docs(storage/500gb): Update hostname for S3 and TUS (supabase#37125)
docs(storage/500gb): Add note about direct storage hostname for large uploads with S3 and TUS
1 parent 1a9c718 commit 1809b1d

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

apps/docs/content/guides/storage/s3/authentication.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ This is all the information you need to connect to Supabase Storage using any S3
2525

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

28+
<Admonition type="note">
29+
30+
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.
31+
32+
Instead of `https://project-id.supabase.co` use `https://project-id.storage.supabase.co`
33+
34+
</Admonition>
35+
2836
<Tabs
2937
scrollable
3038
size="small"
@@ -39,7 +47,7 @@ This is all the information you need to connect to Supabase Storage using any S3
3947
const client = new S3Client({
4048
forcePathStyle: true,
4149
region: 'project_region',
42-
endpoint: 'https://project_ref.supabase.co/storage/v1/s3',
50+
endpoint: 'https://project_ref.storage.supabase.co/storage/v1/s3',
4351
credentials: {
4452
accessKeyId: 'your_access_key_id',
4553
secretAccessKey: 'your_secret_access_key',
@@ -55,7 +63,7 @@ This is all the information you need to connect to Supabase Storage using any S3
5563
[supabase]
5664
aws_access_key_id = your_access_key_id
5765
aws_secret_access_key = your_secret_access_key
58-
endpoint_url = https://project_ref.supabase.co/storage/v1/s3
66+
endpoint_url = https://project_ref.storage.supabase.co/storage/v1/s3
5967
region = project_region
6068
```
6169
</TabPanel>
@@ -86,7 +94,7 @@ const {
8694
const client = new S3Client({
8795
forcePathStyle: true,
8896
region: 'project_region',
89-
endpoint: 'https://project_ref.supabase.co/storage/v1/s3',
97+
endpoint: 'https://project_ref.storage.supabase.co/storage/v1/s3',
9098
credentials: {
9199
accessKeyId: 'project_ref',
92100
secretAccessKey: 'anonKey',

apps/docs/content/guides/storage/uploads/resumable-uploads.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ The resumable upload method is recommended when:
1414

1515
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.
1616

17+
<Admonition type="note">
18+
19+
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.
20+
21+
Instead of `https://project-id.supabase.co` use `https://project-id.storage.supabase.co`
22+
23+
</Admonition>
24+
1725
<Tabs
1826
scrollable
1927
size="small"
@@ -35,7 +43,8 @@ Supabase Storage implements the [TUS protocol](https://tus.io/) to enable resuma
3543

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

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

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

0 commit comments

Comments
 (0)