How to correctly set React API URL env variable for Self hosted
Hello,
I'm self hosting Supabase with Docker, using React as Front-End and I got to observe that communicating with the project's API works fine when it's the online Supabase app, however, not working fine when it's the self hosted one.
What I'm trying to do on the client app is basic magic link authentication. However, with self hosted API URL in .env, when submitting form, it will only throw me error alert popup ("Error sending confirmation mail").
I've tried to observe and compare differences between my online API and the local API. The "supabase.co" root API URL (no endpoint) returns plain JSON saying "No API key found in request" (which I send when creating the supabaseClient in React so at least, I can figure out that the root URL with no endpoint is the right one. However, when I do the same thing with the local API, it only returns plain JSON saying "No Route matched with those value" and at first I thought the problem was that the root URL with no endpoint of both remote and local API are differents and so I found out that the local API's endpoint "/rest/v1" returns HTML content saying "Kong Error - No API key found in request". Of course, when I try to set the local React API URL .env variable with the "/rest/v1" part, submitting form doesn't work and only throws me error alert popup ("Content-Type not acceptable: text/plain").
So my question is : what am I doing wrong ? Is there something I missed ? I really don't understand to this point. I've readen a lot of Github issues topics more or less related to self hosted version and generally, it invites me to read the Self hosted documentation which, in my case for this issue, isn't very informative because no further documentation about self hosted env variable React side...
Thanks a lot if you've readen this far.
Edit : I feel like that if there should be informations about React .env variables in documentation it should be there but it isn't : https://supabase.com/docs/guides/with-react .
I'm self hosting Supabase with Docker, using React as Front-End and I got to observe that communicating with the project's API works fine when it's the online Supabase app, however, not working fine when it's the self hosted one.
What I'm trying to do on the client app is basic magic link authentication. However, with self hosted API URL in .env, when submitting form, it will only throw me error alert popup ("Error sending confirmation mail").
I've tried to observe and compare differences between my online API and the local API. The "supabase.co" root API URL (no endpoint) returns plain JSON saying "No API key found in request" (which I send when creating the supabaseClient in React so at least, I can figure out that the root URL with no endpoint is the right one. However, when I do the same thing with the local API, it only returns plain JSON saying "No Route matched with those value" and at first I thought the problem was that the root URL with no endpoint of both remote and local API are differents and so I found out that the local API's endpoint "/rest/v1" returns HTML content saying "Kong Error - No API key found in request". Of course, when I try to set the local React API URL .env variable with the "/rest/v1" part, submitting form doesn't work and only throws me error alert popup ("Content-Type not acceptable: text/plain").
So my question is : what am I doing wrong ? Is there something I missed ? I really don't understand to this point. I've readen a lot of Github issues topics more or less related to self hosted version and generally, it invites me to read the Self hosted documentation which, in my case for this issue, isn't very informative because no further documentation about self hosted env variable React side...
Thanks a lot if you've readen this far.
Edit : I feel like that if there should be informations about React .env variables in documentation it should be there but it isn't : https://supabase.com/docs/guides/with-react .

Learn how to use Supabase in your React App.