Creates a Supabase Client for use in a browser environment.
In most cases you should not configure the options.cookies object, as this
is automatically handled for you. If you do customize this, prefer using the
getAll and setAll functions over get, set and remove. The latter
are deprecated due to being difficult to correctly implement and not
supporting some edge-cases. Both getAll and setAll (or both get, set
and remove) must be provided. Failing to provide the methods for setting
will throw an exception, and in previous versions of the library will result
in difficult to debug authentication issues such as random logouts, early
session termination or problems with inconsistent state.
The auth.storage option is ignored. The session is always persisted via
cookies so that a server-rendered request can read it. Passing
options.auth.storage has no effect — a one-time console warning is logged
if you do. (options.auth.userStorage is still respected when cookies.encode is "tokens-only".)
If you don't need the session to be readable server-side, use
@supabase/supabase-js's createClient directly with your own storage
instead; @supabase/ssr isn't needed in that case.
Creates a Supabase Client for use in a browser environment.
In most cases you should not configure the
options.cookiesobject, as this is automatically handled for you. If you do customize this, prefer using thegetAllandsetAllfunctions overget,setandremove. The latter are deprecated due to being difficult to correctly implement and not supporting some edge-cases. BothgetAllandsetAll(or bothget,setandremove) must be provided. Failing to provide the methods for setting will throw an exception, and in previous versions of the library will result in difficult to debug authentication issues such as random logouts, early session termination or problems with inconsistent state.The
auth.storageoption is ignored. The session is always persisted via cookies so that a server-rendered request can read it. Passingoptions.auth.storagehas no effect — a one-time console warning is logged if you do. (options.auth.userStorageis still respected whencookies.encodeis"tokens-only".) If you don't need the session to be readable server-side, use@supabase/supabase-js'screateClientdirectly with your ownstorageinstead;@supabase/ssrisn't needed in that case.