DEV Community

Using Supabase as a database and image store with Strapi CMS.

Tea Reggi on October 01, 2023

I love the idea of a headless CMS to maintain my own personal API. The goal is to have a central source for all your data, blog posts, link lists, ...
Collapse
 
kalrious profile image
KALrious

Great read! I found the part about leveraging Strapi with Supabase particularly insightful—I hadn’t considered that combination before. Have you had a chance to try out the Supabase-specific CMS? cms
I’d love to hear your thoughts on how it compares!

Collapse
 
drimescodes profile image
drimescodes

For me I wanted to serve the images straight from cloudinary
Like the images would be saved on cloudinary instead of supabase directly cause cloudinary has more space limit, but somehow somehow, the images aren't showing in the frontend and not also showing in supabase.

my PLUGINS.js

Image description

my middleware.js

Image description

PS:This is my first time using strapi

Collapse
 
adamatronix profile image
Adam Gee

I'm still getting error: new row violates row-level security policy when trying to upload images. I basically created policies for all actions in Supabase. Any ideas?

Collapse
 
adamatronix profile image
Adam Gee

Sorry, for anyone making the same mistake, you need to use the sercret service role api key, not the anon/public one.

Collapse
 
sanditzz profile image
PO • Edited

This worked thank you! However, my thumbnails are not appearing. Any idea?

Image description

There's a message Loading Strapi(node:28648) Warning: The upload provider "strapi-provider-upload-supabase" doesn't implement the uploadStream function. Strapi will fallback on the upload method. Some performance issues may occur. when running develop locally as well. Not sure what it means.

Collapse
 
czapata08 profile image
Carlos Zapata

Thanks for the article, I'm also working with strapi and supabase. I'm curious to know which strapi and node version are you running?

Collapse
 
reggi profile image
Tea Reggi

Node.js v18.17.1 / "@strapi/strapi": "4.14.0",

Collapse
 
czapata08 profile image
Carlos Zapata • Edited

Awesome man, I'm still trying to hook it up to my storage. I have set the policy but I'm encountering error code 500 "JWT Malformed". Any recommendations on setting up the policies?

Thread Thread
 
reggi profile image
Tea Reggi

I had to remove row level policies for the object store check the stack overflow link for deets