[@supabase/ssr] Documentation for createServerClient
& createBrowserClient
#754
Labels
documentation
Improvements or additions to documentation
Improve documentation
Link
createServerClient
createBrowserClient
Describe the problem
Function names are pretty much self-explanatory but as I was reading through the implementation, both
createServerClient
andcreateBrowserClient
have some conditional logic based on whether they're running on a browser, which I found to be surprising.Describe the improvement
Add docs to clarify difference between functions and consequences of using them in the wrong env (e.g. what happens when
createBrowserClient
is used in server-side components and vice-versa).Additionally:
Additional context
n/a
Happy to submit a PR with proposed changes once I understand the crossed-env usage caveats (mainly
createBrowserClient
on server-side, sincecreateServerClient
withcookies()
on client-side will naturally fail due to "(...) importing a component that needs next/headers (...)".The text was updated successfully, but these errors were encountered: