Initializing

Create a new client for use in the browser.

import { GoTrueClient } from '@supabase/gotrue-js'
const auth = new GoTrueClient({
url: "https://your-gotrue-url.com",
headers: {
apikey:
"<SOME-API-KEY>",
Authorization:
"Bearer <SOME-JWT>",
},
})

Parameters

  • optionsrequiredobject

    No description provided.

      Properties
    • autoRefreshTokenoptional| |

      Set to "true" if you want to automatically refresh the token before expiring.

    • detectSessionInUrloptional| |

      Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.

    • headersoptional|

      Any additional headers to send to the GoTrue server.

    • localStorageoptionalStorage

      No description provided.

    • persistSessionoptional| |

      Set to "true" if you want to automatically save the user session into local storage.

    • urloptional|

      The URL of the GoTrue server.

Examples

Initialize a GoTrue client

import { GoTrueClient } from '@supabase/gotrue-js'
const auth = new GoTrueClient({
url: "https://your-gotrue-url.com",
headers: {
apikey:
"<SOME-API-KEY>",
Authorization:
"Bearer <SOME-JWT>",
},
})