mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix: add bearer token to resumable-upload-uppy example (#18789)
This commit is contained in:
1 parent
850d32fe3b
commit
b8707817b6
2 files changed
+6
-4
No files matched your search
@@ -13,6 +13,7 @@ This example shows how to use [Supabase Storage](https://supabase.io/docs/refere
|
||||
const SUPABASE_ANON_KEY = '' // your project's anon key
|
||||
const SUPABASE_PROJECT_ID = '' // your project ref
|
||||
const STORAGE_BUCKET = '' // your storage bucket name
|
||||
const BEARER_TOKEN = '' // your bearer token
|
||||
```
|
||||
|
||||
Serve the index.html file locally (e.g. with Python Simple HTTP Server) and start uploading:
|
||||
|
||||
@@ -44,9 +44,10 @@
|
||||
Tus,
|
||||
} from 'https://releases.transloadit.com/uppy/v3.6.1/uppy.min.mjs'
|
||||
|
||||
const SUPABASE_ANON_KEY = 'repace-with-your-anon-key'
|
||||
const SUPABASE_PROJECT_ID = 'repace-with-your-project-id'
|
||||
const STORAGE_BUCKET = 'repace-with-your-bucket-id'
|
||||
const SUPABASE_ANON_KEY = 'replace-with-your-anon-key'
|
||||
const SUPABASE_PROJECT_ID = 'replace-with-your-project-id'
|
||||
const STORAGE_BUCKET = 'replace-with-your-bucket-id'
|
||||
const BEARER_TOKEN='replace-with-your-bearer-token'
|
||||
|
||||
const folder = ''
|
||||
const supabaseStorageURL = `https://${SUPABASE_PROJECT_ID}.supabase.co/storage/v1/upload/resumable`
|
||||
@@ -61,7 +62,7 @@
|
||||
.use(Tus, {
|
||||
endpoint: supabaseStorageURL,
|
||||
headers: {
|
||||
authorization: `Bearer ${SUPABASE_ANON_KEY}`,
|
||||
authorization: `Bearer ${BEARER_TOKEN}`,
|
||||
apikey: SUPABASE_ANON_KEY,
|
||||
},
|
||||
uploadDataDuringCreation: true,
|
||||
|
||||
Reference in new issue
Block a user