1.0.19 • Published 1 year ago
strapi-provider-upload-supabase-v4 v1.0.19
Strapi Upload Provider for Supabase storage
- This provider is a fork of shorwood's strapi upload provider digitalocean for Digital Ocean spaces, but applied to Supabase storage
Parameters
- apiUrl : Supabase API Url
- apiKey : Supabase API Key
- bucket : Supabase storage bucket
- directory : Directory inside Supabase storage bucket
- options : Supabase client additional options
How to use
- Install this package
npm i strapi-provider-upload-supabase-v4
- Create config in
./config.js
with content
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: "strapi-provider-upload-supabase-v4",
providerOptions: {
apiUrl: env("SUPABASE_API_URL"),
apiKey: env("SUPABASE_API_KEY"),
bucket: env("SUPABASE_BUCKET"),
directory: env("SUPABASE_DIRECTORY"),
options: {},
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
- Create
.env
and add to them
SUPABASE_API_URL="<Your Supabase url>"
SUPABASE_API_KEY="<Your Supabase api key>"
SUPABASE_BUCKET="strapi-uploads"
SUPABASE_DIRECTORY=""
- Create middleware in
./middlewares.js
with content
module.exports = ({ env }) => [
"strapi::errors",
{
name: "strapi::security",
config: {
contentSecurityPolicy: {
directives: {
"default-src": ["'self'"],
"img-src": ["'self'", "data:", "blob:", env("SUPABASE_API_URL")],
},
},
},
},
"strapi::cors",
"strapi::poweredBy",
"strapi::logger",
"strapi::query",
"strapi::body",
"strapi::session",
"strapi::favicon",
"strapi::public",
];
with values obtained from this page:
https://app.supabase.io/project//settings/api
Parameters options
, bucket
and directory
are optional and you can omit it, they will take the values shown in the example above.
Resources
Links
1.0.19
1 year ago
1.0.18
1 year ago
1.0.17
1 year ago
1.0.16
1 year ago
1.0.15
2 years ago
1.0.14-beta.1
2 years ago
1.0.14-beta.0
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11-beta.1
2 years ago
1.0.11-beta.0
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2-beta.0
2 years ago
1.0.2
2 years ago
1.1.1
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago