When to use SSR with PocketBase #9511
-
Hi All, I'm don't know frontend web development particularly well. So I have some questions around when I should do something on the client vs the server when using SvelteKit. I am building an application with SvelteKit and Pocketbase. The things the make sense to me when to make requests on the server are However the way I have currently setup Pocketbase means I can only authenticate with it on the server side. So at the moment, when a user say clicks a button. Browser -> Netlify Functions -> Fly (PocketBase) It feels like there is a wasted network request in this case. Say all I want to do is delete something from the database. So I guess my question is when should I make requests on the server and when should I do it on the client. Sorry if this question might be a bit too unspecific. I can provide details about my specific use-case. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Make requests on the server if it involves secrets, otherwise you can fetch from the client. |
Beta Was this translation helpful? Give feedback.
-
In this case, I can fetch the JWT token from a cookie on the client side is that acceptable ? Or better done on the server? |
Beta Was this translation helpful? Give feedback.
Make requests on the server if it involves secrets, otherwise you can fetch from the client.