The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
{
"bySlug": {
"introduction": {
"id": "introduction",
"title": "Introduction",
"slug": "introduction",
"type": "markdown"
},
"installing": {
"id": "installing",
"title": "Installing",
"slug": "installing",
"type": "markdown"
},
"initializing": {
"id": "initializing",
"title": "Initializing",
"slug": "initializing",
"type": "function"
},
"typescript-support": {
"id": "typescript-support",
"title": "TypeScript support",
"slug": "typescript-support",
"type": "markdown"
},
"database": {
"type": "category",
"title": "Database"
},
"delete": {
"id": "delete",
"title": "delete",
"slug": "delete",
"product": "database",
"type": "function"
},
"from": {
"id": "from",
"title": "from",
"slug": "from",
"product": "database",
"type": "function"
},
"insert": {
"id": "insert",
"title": "insert",
"slug": "insert",
"product": "database",
"type": "function"
},
"rpc": {
"id": "rpc",
"title": "rpc",
"slug": "rpc",
"product": "database",
"type": "function"
},
"schema": {
"id": "schema",
"title": "schema",
"slug": "schema",
"product": "database",
"type": "function"
},
"select": {
"id": "select",
"title": "select",
"slug": "select",
"product": "database",
"type": "function"
},
"update": {
"id": "update",
"title": "update",
"slug": "update",
"product": "database",
"type": "function"
},
"upsert": {
"id": "upsert",
"title": "upsert",
"slug": "upsert",
"product": "database",
"type": "function"
},
"using-filters": {
"id": "using-filters",
"title": "Using Filters",
"slug": "using-filters",
"type": "function"
},
"using-filters-containedby": {
"id": "using-filters-containedby",
"title": "containedBy",
"slug": "using-filters-containedby",
"product": "database",
"type": "function"
},
"using-filters-contains": {
"id": "using-filters-contains",
"title": "contains",
"slug": "using-filters-contains",
"product": "database",
"type": "function"
},
"using-filters-eq": {
"id": "using-filters-eq",
"title": "eq",
"slug": "using-filters-eq",
"product": "database",
"type": "function"
},
"using-filters-filter": {
"id": "using-filters-filter",
"title": "filter",
"slug": "using-filters-filter",
"product": "database",
"type": "function"
},
"using-filters-gt": {
"id": "using-filters-gt",
"title": "gt",
"slug": "using-filters-gt",
"product": "database",
"type": "function"
},
"using-filters-gte": {
"id": "using-filters-gte",
"title": "gte",
"slug": "using-filters-gte",
"product": "database",
"type": "function"
},
"using-filters-ilike": {
"id": "using-filters-ilike",
"title": "ilike",
"slug": "using-filters-ilike",
"product": "database",
"type": "function"
},
"using-filters-ilikeallof": {
"id": "using-filters-ilikeallof",
"title": "ilikeAllOf",
"slug": "using-filters-ilikeallof",
"product": "database",
"type": "function"
},
"using-filters-ilikeanyof": {
"id": "using-filters-ilikeanyof",
"title": "ilikeAnyOf",
"slug": "using-filters-ilikeanyof",
"product": "database",
"type": "function"
},
"using-filters-in": {
"id": "using-filters-in",
"title": "in",
"slug": "using-filters-in",
"product": "database",
"type": "function"
},
"using-filters-is": {
"id": "using-filters-is",
"title": "is",
"slug": "using-filters-is",
"product": "database",
"type": "function"
},
"using-filters-like": {
"id": "using-filters-like",
"title": "like",
"slug": "using-filters-like",
"product": "database",
"type": "function"
},
"using-filters-likeallof": {
"id": "using-filters-likeallof",
"title": "likeAllOf",
"slug": "using-filters-likeallof",
"product": "database",
"type": "function"
},
"using-filters-likeanyof": {
"id": "using-filters-likeanyof",
"title": "likeAnyOf",
"slug": "using-filters-likeanyof",
"product": "database",
"type": "function"
},
"using-filters-lt": {
"id": "using-filters-lt",
"title": "lt",
"slug": "using-filters-lt",
"product": "database",
"type": "function"
},
"using-filters-lte": {
"id": "using-filters-lte",
"title": "lte",
"slug": "using-filters-lte",
"product": "database",
"type": "function"
},
"using-filters-match": {
"id": "using-filters-match",
"title": "match",
"slug": "using-filters-match",
"product": "database",
"type": "function"
},
"using-filters-neq": {
"id": "using-filters-neq",
"title": "neq",
"slug": "using-filters-neq",
"product": "database",
"type": "function"
},
"using-filters-not": {
"id": "using-filters-not",
"title": "not",
"slug": "using-filters-not",
"product": "database",
"type": "function"
},
"using-filters-or": {
"id": "using-filters-or",
"title": "or",
"slug": "using-filters-or",
"product": "database",
"type": "function"
},
"using-filters-overlaps": {
"id": "using-filters-overlaps",
"title": "overlaps",
"slug": "using-filters-overlaps",
"product": "database",
"type": "function"
},
"using-filters-rangeadjacent": {
"id": "using-filters-rangeadjacent",
"title": "rangeAdjacent",
"slug": "using-filters-rangeadjacent",
"product": "database",
"type": "function"
},
"using-filters-rangegt": {
"id": "using-filters-rangegt",
"title": "rangeGt",
"slug": "using-filters-rangegt",
"product": "database",
"type": "function"
},
"using-filters-rangegte": {
"id": "using-filters-rangegte",
"title": "rangeGte",
"slug": "using-filters-rangegte",
"product": "database",
"type": "function"
},
"using-filters-rangelt": {
"id": "using-filters-rangelt",
"title": "rangeLt",
"slug": "using-filters-rangelt",
"product": "database",
"type": "function"
},
"using-filters-rangelte": {
"id": "using-filters-rangelte",
"title": "rangeLte",
"slug": "using-filters-rangelte",
"product": "database",
"type": "function"
},
"using-filters-textsearch": {
"id": "using-filters-textsearch",
"title": "textSearch",
"slug": "using-filters-textsearch",
"product": "database",
"type": "function"
},
"using-modifiers": {
"id": "using-modifiers",
"title": "Using modifiers",
"slug": "using-modifiers",
"type": "function"
},
"using-modifiers-abortsignal": {
"id": "using-modifiers-abortsignal",
"title": "abortSignal",
"slug": "using-modifiers-abortsignal",
"product": "database",
"type": "function"
},
"using-modifiers-csv": {
"id": "using-modifiers-csv",
"title": "csv",
"slug": "using-modifiers-csv",
"product": "database",
"type": "function"
},
"using-modifiers-explain": {
"id": "using-modifiers-explain",
"title": "explain",
"slug": "using-modifiers-explain",
"product": "database",
"type": "function"
},
"using-modifiers-geojson": {
"id": "using-modifiers-geojson",
"title": "geojson",
"slug": "using-modifiers-geojson",
"product": "database",
"type": "function"
},
"using-modifiers-limit": {
"id": "using-modifiers-limit",
"title": "limit",
"slug": "using-modifiers-limit",
"product": "database",
"type": "function"
},
"using-modifiers-maxaffected": {
"id": "using-modifiers-maxaffected",
"title": "maxAffected",
"slug": "using-modifiers-maxaffected",
"product": "database",
"type": "function"
},
"using-modifiers-maybesingle": {
"id": "using-modifiers-maybesingle",
"title": "maybeSingle",
"slug": "using-modifiers-maybesingle",
"product": "database",
"type": "function"
},
"using-modifiers-order": {
"id": "using-modifiers-order",
"title": "order",
"slug": "using-modifiers-order",
"product": "database",
"type": "function"
},
"using-modifiers-overridetypes": {
"id": "using-modifiers-overridetypes",
"title": "overrideTypes",
"slug": "using-modifiers-overridetypes",
"product": "database",
"type": "function"
},
"using-modifiers-range": {
"id": "using-modifiers-range",
"title": "range",
"slug": "using-modifiers-range",
"product": "database",
"type": "function"
},
"using-modifiers-retry": {
"id": "using-modifiers-retry",
"title": "retry",
"slug": "using-modifiers-retry",
"product": "database",
"type": "function"
},
"using-modifiers-returns": {
"id": "using-modifiers-returns",
"title": "returns",
"slug": "using-modifiers-returns",
"product": "database",
"type": "function"
},
"using-modifiers-rollback": {
"id": "using-modifiers-rollback",
"title": "rollback",
"slug": "using-modifiers-rollback",
"product": "database",
"type": "function"
},
"using-modifiers-select": {
"id": "using-modifiers-select",
"title": "select",
"slug": "using-modifiers-select",
"product": "database",
"type": "function"
},
"using-modifiers-setheader": {
"id": "using-modifiers-setheader",
"title": "setHeader",
"slug": "using-modifiers-setheader",
"product": "database",
"type": "function"
},
"using-modifiers-single": {
"id": "using-modifiers-single",
"title": "single",
"slug": "using-modifiers-single",
"product": "database",
"type": "function"
},
"using-modifiers-stripnulls": {
"id": "using-modifiers-stripnulls",
"title": "stripNulls",
"slug": "using-modifiers-stripnulls",
"product": "database",
"type": "function"
},
"using-modifiers-throwonerror": {
"id": "using-modifiers-throwonerror",
"title": "throwOnError",
"slug": "using-modifiers-throwonerror",
"product": "database",
"type": "function"
},
"auth": {
"id": "auth",
"title": "Overview",
"slug": "auth",
"type": "function"
},
"auth-dispose": {
"id": "auth-dispose",
"title": "dispose",
"slug": "auth-dispose",
"product": "auth",
"type": "function"
},
"auth-exchangecodeforsession": {
"id": "auth-exchangecodeforsession",
"title": "exchangeCodeForSession",
"slug": "auth-exchangecodeforsession",
"product": "auth",
"type": "function"
},
"auth-getclaims": {
"id": "auth-getclaims",
"title": "getClaims",
"slug": "auth-getclaims",
"product": "auth",
"type": "function"
},
"auth-getsession": {
"id": "auth-getsession",
"title": "getSession",
"slug": "auth-getsession",
"product": "auth",
"type": "function"
},
"auth-getuser": {
"id": "auth-getuser",
"title": "getUser",
"slug": "auth-getuser",
"product": "auth",
"type": "function"
},
"auth-getuseridentities": {
"id": "auth-getuseridentities",
"title": "getUserIdentities",
"slug": "auth-getuseridentities",
"product": "auth",
"type": "function"
},
"auth-initialize": {
"id": "auth-initialize",
"title": "initialize",
"slug": "auth-initialize",
"product": "auth",
"type": "function"
},
"auth-linkidentity": {
"id": "auth-linkidentity",
"title": "linkIdentity",
"slug": "auth-linkidentity",
"product": "auth",
"type": "function"
},
"auth-onauthstatechange": {
"id": "auth-onauthstatechange",
"title": "onAuthStateChange",
"slug": "auth-onauthstatechange",
"product": "auth",
"type": "function"
},
"auth-reauthenticate": {
"id": "auth-reauthenticate",
"title": "reauthenticate",
"slug": "auth-reauthenticate",
"product": "auth",
"type": "function"
},
"auth-refreshsession": {
"id": "auth-refreshsession",
"title": "refreshSession",
"slug": "auth-refreshsession",
"product": "auth",
"type": "function"
},
"auth-registerpasskey": {
"id": "auth-registerpasskey",
"title": "registerPasskey",
"slug": "auth-registerpasskey",
"product": "auth",
"type": "function"
},
"auth-resend": {
"id": "auth-resend",
"title": "resend",
"slug": "auth-resend",
"product": "auth",
"type": "function"
},
"auth-resetpasswordforemail": {
"id": "auth-resetpasswordforemail",
"title": "resetPasswordForEmail",
"slug": "auth-resetpasswordforemail",
"product": "auth",
"type": "function"
},
"auth-setsession": {
"id": "auth-setsession",
"title": "setSession",
"slug": "auth-setsession",
"product": "auth",
"type": "function"
},
"auth-signinanonymously": {
"id": "auth-signinanonymously",
"title": "signInAnonymously",
"slug": "auth-signinanonymously",
"product": "auth",
"type": "function"
},
"auth-signinwithidtoken": {
"id": "auth-signinwithidtoken",
"title": "signInWithIdToken",
"slug": "auth-signinwithidtoken",
"product": "auth",
"type": "function"
},
"auth-signinwithoauth": {
"id": "auth-signinwithoauth",
"title": "signInWithOAuth",
"slug": "auth-signinwithoauth",
"product": "auth",
"type": "function"
},
"auth-signinwithotp": {
"id": "auth-signinwithotp",
"title": "signInWithOtp",
"slug": "auth-signinwithotp",
"product": "auth",
"type": "function"
},
"auth-signinwithpasskey": {
"id": "auth-signinwithpasskey",
"title": "signInWithPasskey",
"slug": "auth-signinwithpasskey",
"product": "auth",
"type": "function"
},
"auth-signinwithpassword": {
"id": "auth-signinwithpassword",
"title": "signInWithPassword",
"slug": "auth-signinwithpassword",
"product": "auth",
"type": "function"
},
"auth-signinwithsso": {
"id": "auth-signinwithsso",
"title": "signInWithSSO",
"slug": "auth-signinwithsso",
"product": "auth",
"type": "function"
},
"auth-signinwithweb3": {
"id": "auth-signinwithweb3",
"title": "signInWithWeb3",
"slug": "auth-signinwithweb3",
"product": "auth",
"type": "function"
},
"auth-signout": {
"id": "auth-signout",
"title": "signOut",
"slug": "auth-signout",
"product": "auth",
"type": "function"
},
"auth-signup": {
"id": "auth-signup",
"title": "signUp",
"slug": "auth-signup",
"product": "auth",
"type": "function"
},
"auth-startautorefresh": {
"id": "auth-startautorefresh",
"title": "startAutoRefresh",
"slug": "auth-startautorefresh",
"product": "auth",
"type": "function"
},
"auth-stopautorefresh": {
"id": "auth-stopautorefresh",
"title": "stopAutoRefresh",
"slug": "auth-stopautorefresh",
"product": "auth",
"type": "function"
},
"auth-unlinkidentity": {
"id": "auth-unlinkidentity",
"title": "unlinkIdentity",
"slug": "auth-unlinkidentity",
"product": "auth",
"type": "function"
},
"auth-updateuser": {
"id": "auth-updateuser",
"title": "updateUser",
"slug": "auth-updateuser",
"product": "auth",
"type": "function"
},
"auth-verifyotp": {
"id": "auth-verifyotp",
"title": "verifyOtp",
"slug": "auth-verifyotp",
"product": "auth",
"type": "function"
},
"auth-admin": {
"id": "auth-admin",
"title": "Overview",
"slug": "auth-admin",
"type": "function"
},
"auth-admin-createprovider": {
"id": "auth-admin-createprovider",
"title": "createProvider",
"slug": "auth-admin-createprovider",
"product": "auth",
"type": "function"
},
"auth-admin-createuser": {
"id": "auth-admin-createuser",
"title": "createUser",
"slug": "auth-admin-createuser",
"product": "auth",
"type": "function"
},
"auth-admin-deletefactor": {
"id": "auth-admin-deletefactor",
"title": "deleteFactor",
"slug": "auth-admin-deletefactor",
"product": "auth",
"type": "function"
},
"auth-admin-deleteprovider": {
"id": "auth-admin-deleteprovider",
"title": "deleteProvider",
"slug": "auth-admin-deleteprovider",
"product": "auth",
"type": "function"
},
"auth-admin-deleteuser": {
"id": "auth-admin-deleteuser",
"title": "deleteUser",
"slug": "auth-admin-deleteuser",
"product": "auth",
"type": "function"
},
"auth-admin-generatelink": {
"id": "auth-admin-generatelink",
"title": "generateLink",
"slug": "auth-admin-generatelink",
"product": "auth",
"type": "function"
},
"auth-admin-getprovider": {
"id": "auth-admin-getprovider",
"title": "getProvider",
"slug": "auth-admin-getprovider",
"product": "auth",
"type": "function"
},
"auth-admin-getuserbyid": {
"id": "auth-admin-getuserbyid",
"title": "getUserById",
"slug": "auth-admin-getuserbyid",
"product": "auth",
"type": "function"
},
"auth-admin-inviteuserbyemail": {
"id": "auth-admin-inviteuserbyemail",
"title": "inviteUserByEmail",
"slug": "auth-admin-inviteuserbyemail",
"product": "auth",
"type": "function"
},
"auth-admin-listfactors": {
"id": "auth-admin-listfactors",
"title": "listFactors",
"slug": "auth-admin-listfactors",
"product": "auth",
"type": "function"
},
"auth-admin-listproviders": {
"id": "auth-admin-listproviders",
"title": "listProviders",
"slug": "auth-admin-listproviders",
"product": "auth",
"type": "function"
},
"auth-admin-listusers": {
"id": "auth-admin-listusers",
"title": "listUsers",
"slug": "auth-admin-listusers",
"product": "auth",
"type": "function"
},
"auth-admin-signout": {
"id": "auth-admin-signout",
"title": "signOut",
"slug": "auth-admin-signout",
"product": "auth",
"type": "function"
},
"auth-admin-updateprovider": {
"id": "auth-admin-updateprovider",
"title": "updateProvider",
"slug": "auth-admin-updateprovider",
"product": "auth",
"type": "function"
},
"auth-admin-updateuserbyid": {
"id": "auth-admin-updateuserbyid",
"title": "updateUserById",
"slug": "auth-admin-updateuserbyid",
"product": "auth",
"type": "function"
},
"auth-mfa": {
"id": "auth-mfa",
"title": "Auth MFA",
"slug": "auth-mfa",
"type": "function"
},
"auth-mfa-challenge": {
"id": "auth-mfa-challenge",
"title": "challenge",
"slug": "auth-mfa-challenge",
"product": "auth",
"type": "function"
},
"auth-mfa-challengeandverify": {
"id": "auth-mfa-challengeandverify",
"title": "challengeAndVerify",
"slug": "auth-mfa-challengeandverify",
"product": "auth",
"type": "function"
},
"auth-mfa-enroll": {
"id": "auth-mfa-enroll",
"title": "enroll",
"slug": "auth-mfa-enroll",
"product": "auth",
"type": "function"
},
"auth-mfa-getauthenticatorassurancelevel": {
"id": "auth-mfa-getauthenticatorassurancelevel",
"title": "getAuthenticatorAssuranceLevel",
"slug": "auth-mfa-getauthenticatorassurancelevel",
"product": "auth",
"type": "function"
},
"auth-mfa-listfactors": {
"id": "auth-mfa-listfactors",
"title": "listFactors",
"slug": "auth-mfa-listfactors",
"product": "auth",
"type": "function"
},
"auth-mfa-unenroll": {
"id": "auth-mfa-unenroll",
"title": "unenroll",
"slug": "auth-mfa-unenroll",
"product": "auth",
"type": "function"
},
"auth-mfa-verify": {
"id": "auth-mfa-verify",
"title": "verify",
"slug": "auth-mfa-verify",
"product": "auth",
"type": "function"
},
"auth-passkey": {
"id": "auth-passkey",
"title": "Auth Passkey",
"slug": "auth-passkey",
"type": "function"
},
"auth-passkey-delete": {
"id": "auth-passkey-delete",
"title": "delete",
"slug": "auth-passkey-delete",
"product": "auth",
"type": "function"
},
"auth-passkey-list": {
"id": "auth-passkey-list",
"title": "list",
"slug": "auth-passkey-list",
"product": "auth",
"type": "function"
},
"auth-passkey-startauthentication": {
"id": "auth-passkey-startauthentication",
"title": "startAuthentication",
"slug": "auth-passkey-startauthentication",
"product": "auth",
"type": "function"
},
"auth-passkey-startregistration": {
"id": "auth-passkey-startregistration",
"title": "startRegistration",
"slug": "auth-passkey-startregistration",
"product": "auth",
"type": "function"
},
"auth-passkey-update": {
"id": "auth-passkey-update",
"title": "update",
"slug": "auth-passkey-update",
"product": "auth",
"type": "function"
},
"auth-passkey-verifyauthentication": {
"id": "auth-passkey-verifyauthentication",
"title": "verifyAuthentication",
"slug": "auth-passkey-verifyauthentication",
"product": "auth",
"type": "function"
},
"auth-passkey-verifyregistration": {
"id": "auth-passkey-verifyregistration",
"title": "verifyRegistration",
"slug": "auth-passkey-verifyregistration",
"product": "auth",
"type": "function"
},
"oauth-admin": {
"id": "oauth-admin",
"title": "OAuth Admin",
"slug": "oauth-admin",
"type": "function"
},
"oauth-admin-createclient": {
"id": "oauth-admin-createclient",
"title": "createClient",
"slug": "oauth-admin-createclient",
"product": "auth",
"type": "function"
},
"oauth-admin-deleteclient": {
"id": "oauth-admin-deleteclient",
"title": "deleteClient",
"slug": "oauth-admin-deleteclient",
"product": "auth",
"type": "function"
},
"oauth-admin-getclient": {
"id": "oauth-admin-getclient",
"title": "getClient",
"slug": "oauth-admin-getclient",
"product": "auth",
"type": "function"
},
"oauth-admin-listclients": {
"id": "oauth-admin-listclients",
"title": "listClients",
"slug": "oauth-admin-listclients",
"product": "auth",
"type": "function"
},
"oauth-admin-regenerateclientsecret": {
"id": "oauth-admin-regenerateclientsecret",
"title": "regenerateClientSecret",
"slug": "oauth-admin-regenerateclientsecret",
"product": "auth",
"type": "function"
},
"oauth-admin-updateclient": {
"id": "oauth-admin-updateclient",
"title": "updateClient",
"slug": "oauth-admin-updateclient",
"product": "auth",
"type": "function"
},
"oauth-server": {
"id": "oauth-server",
"title": "OAuth Server",
"slug": "oauth-server",
"type": "function"
},
"oauth-server-approveauthorization": {
"id": "oauth-server-approveauthorization",
"title": "approveAuthorization",
"slug": "oauth-server-approveauthorization",
"product": "auth",
"type": "function"
},
"oauth-server-denyauthorization": {
"id": "oauth-server-denyauthorization",
"title": "denyAuthorization",
"slug": "oauth-server-denyauthorization",
"product": "auth",
"type": "function"
},
"oauth-server-getauthorizationdetails": {
"id": "oauth-server-getauthorizationdetails",
"title": "getAuthorizationDetails",
"slug": "oauth-server-getauthorizationdetails",
"product": "auth",
"type": "function"
},
"oauth-server-listgrants": {
"id": "oauth-server-listgrants",
"title": "listGrants",
"slug": "oauth-server-listgrants",
"product": "auth",
"type": "function"
},
"oauth-server-revokegrant": {
"id": "oauth-server-revokegrant",
"title": "revokeGrant",
"slug": "oauth-server-revokegrant",
"product": "auth",
"type": "function"
},
"passkey-admin": {
"id": "passkey-admin",
"title": "Passkey admin",
"slug": "passkey-admin",
"type": "function"
},
"passkey-admin-deletepasskey": {
"id": "passkey-admin-deletepasskey",
"title": "deletePasskey",
"slug": "passkey-admin-deletepasskey",
"product": "auth",
"type": "function"
},
"passkey-admin-listpasskeys": {
"id": "passkey-admin-listpasskeys",
"title": "listPasskeys",
"slug": "passkey-admin-listpasskeys",
"product": "auth",
"type": "function"
},
"functions": {
"type": "category",
"title": "Edge Functions"
},
"functions-corsheaders": {
"id": "functions-corsheaders",
"title": "corsHeaders",
"slug": "functions-corsheaders",
"product": "edge-functions",
"type": "function"
},
"functions-invoke": {
"id": "functions-invoke",
"title": "invoke",
"slug": "functions-invoke",
"product": "edge-functions",
"type": "function"
},
"functions-setauth": {
"id": "functions-setauth",
"title": "setAuth",
"slug": "functions-setauth",
"product": "edge-functions",
"type": "function"
},
"realtime": {
"type": "category",
"title": "Realtime"
},
"channel": {
"id": "channel",
"title": "channel",
"slug": "channel",
"product": "realtime",
"type": "function"
},
"connect": {
"id": "connect",
"title": "connect",
"slug": "connect",
"product": "realtime",
"type": "function"
},
"connectionstate": {
"id": "connectionstate",
"title": "connectionState",
"slug": "connectionstate",
"product": "realtime",
"type": "function"
},
"disconnect": {
"id": "disconnect",
"title": "disconnect",
"slug": "disconnect",
"product": "realtime",
"type": "function"
},
"endpointurl": {
"id": "endpointurl",
"title": "endpointURL",
"slug": "endpointurl",
"product": "realtime",
"type": "function"
},
"getchannels": {
"id": "getchannels",
"title": "getChannels",
"slug": "getchannels",
"product": "realtime",
"type": "function"
},
"getwebsocketconstructor": {
"id": "getwebsocketconstructor",
"title": "getWebSocketConstructor",
"slug": "getwebsocketconstructor",
"product": "realtime",
"type": "function"
},
"httpsend": {
"id": "httpsend",
"title": "httpSend",
"slug": "httpsend",
"product": "realtime",
"type": "function"
},
"isconnected": {
"id": "isconnected",
"title": "isConnected",
"slug": "isconnected",
"product": "realtime",
"type": "function"
},
"isconnecting": {
"id": "isconnecting",
"title": "isConnecting",
"slug": "isconnecting",
"product": "realtime",
"type": "function"
},
"isdisconnecting": {
"id": "isdisconnecting",
"title": "isDisconnecting",
"slug": "isdisconnecting",
"product": "realtime",
"type": "function"
},
"iswebsocketsupported": {
"id": "iswebsocketsupported",
"title": "isWebSocketSupported",
"slug": "iswebsocketsupported",
"product": "realtime",
"type": "function"
},
"log": {
"id": "log",
"title": "log",
"slug": "log",
"product": "realtime",
"type": "function"
},
"on": {
"id": "on",
"title": "on",
"slug": "on",
"product": "realtime",
"type": "function"
},
"onheartbeat": {
"id": "onheartbeat",
"title": "onHeartbeat",
"slug": "onheartbeat",
"product": "realtime",
"type": "function"
},
"presencestate": {
"id": "presencestate",
"title": "presenceState",
"slug": "presencestate",
"product": "realtime",
"type": "function"
},
"push": {
"id": "push",
"title": "push",
"slug": "push",
"product": "realtime",
"type": "function"
},
"removeallchannels": {
"id": "removeallchannels",
"title": "removeAllChannels",
"slug": "removeallchannels",
"product": "realtime",
"type": "function"
},
"removechannel": {
"id": "removechannel",
"title": "removeChannel",
"slug": "removechannel",
"product": "realtime",
"type": "function"
},
"send": {
"id": "send",
"title": "send",
"slug": "send",
"product": "realtime",
"type": "function"
},
"sendheartbeat": {
"id": "sendheartbeat",
"title": "sendHeartbeat",
"slug": "sendheartbeat",
"product": "realtime",
"type": "function"
},
"setauth": {
"id": "setauth",
"title": "setAuth",
"slug": "setauth",
"product": "realtime",
"type": "function"
},
"subscribe": {
"id": "subscribe",
"title": "subscribe",
"slug": "subscribe",
"product": "realtime",
"type": "function"
},
"teardown": {
"id": "teardown",
"title": "teardown",
"slug": "teardown",
"product": "realtime",
"type": "function"
},
"track": {
"id": "track",
"title": "track",
"slug": "track",
"product": "realtime",
"type": "function"
},
"unsubscribe": {
"id": "unsubscribe",
"title": "unsubscribe",
"slug": "unsubscribe",
"product": "realtime",
"type": "function"
},
"untrack": {
"id": "untrack",
"title": "untrack",
"slug": "untrack",
"product": "realtime",
"type": "function"
},
"updatejoinpayload": {
"id": "updatejoinpayload",
"title": "updateJoinPayload",
"slug": "updatejoinpayload",
"product": "realtime",
"type": "function"
},
"storage": {
"type": "category",
"title": "Storage"
},
"analytics-buckets": {
"id": "analytics-buckets",
"title": "Analytics Buckets",
"slug": "analytics-buckets",
"type": "function"
},
"analytics-buckets-createbucket": {
"id": "analytics-buckets-createbucket",
"title": "createBucket",
"slug": "analytics-buckets-createbucket",
"product": "storage",
"type": "function"
},
"analytics-buckets-deletebucket": {
"id": "analytics-buckets-deletebucket",
"title": "deleteBucket",
"slug": "analytics-buckets-deletebucket",
"product": "storage",
"type": "function"
},
"analytics-buckets-from": {
"id": "analytics-buckets-from",
"title": "from",
"slug": "analytics-buckets-from",
"product": "storage",
"type": "function"
},
"analytics-buckets-listbuckets": {
"id": "analytics-buckets-listbuckets",
"title": "listBuckets",
"slug": "analytics-buckets-listbuckets",
"product": "storage",
"type": "function"
},
"file-buckets": {
"id": "file-buckets",
"title": "File Buckets",
"slug": "file-buckets",
"type": "function"
},
"file-buckets-copy": {
"id": "file-buckets-copy",
"title": "copy",
"slug": "file-buckets-copy",
"product": "storage",
"type": "function"
},
"file-buckets-createbucket": {
"id": "file-buckets-createbucket",
"title": "createBucket",
"slug": "file-buckets-createbucket",
"product": "storage",
"type": "function"
},
"file-buckets-createsigneduploadurl": {
"id": "file-buckets-createsigneduploadurl",
"title": "createSignedUploadUrl",
"slug": "file-buckets-createsigneduploadurl",
"product": "storage",
"type": "function"
},
"file-buckets-createsignedurl": {
"id": "file-buckets-createsignedurl",
"title": "createSignedUrl",
"slug": "file-buckets-createsignedurl",
"product": "storage",
"type": "function"
},
"file-buckets-createsignedurls": {
"id": "file-buckets-createsignedurls",
"title": "createSignedUrls",
"slug": "file-buckets-createsignedurls",
"product": "storage",
"type": "function"
},
"file-buckets-deletebucket": {
"id": "file-buckets-deletebucket",
"title": "deleteBucket",
"slug": "file-buckets-deletebucket",
"product": "storage",
"type": "function"
},
"file-buckets-download": {
"id": "file-buckets-download",
"title": "download",
"slug": "file-buckets-download",
"product": "storage",
"type": "function"
},
"file-buckets-emptybucket": {
"id": "file-buckets-emptybucket",
"title": "emptyBucket",
"slug": "file-buckets-emptybucket",
"product": "storage",
"type": "function"
},
"file-buckets-exists": {
"id": "file-buckets-exists",
"title": "exists",
"slug": "file-buckets-exists",
"product": "storage",
"type": "function"
},
"file-buckets-from": {
"id": "file-buckets-from",
"title": "from",
"slug": "file-buckets-from",
"product": "storage",
"type": "function"
},
"file-buckets-getbucket": {
"id": "file-buckets-getbucket",
"title": "getBucket",
"slug": "file-buckets-getbucket",
"product": "storage",
"type": "function"
},
"file-buckets-getpublicurl": {
"id": "file-buckets-getpublicurl",
"title": "getPublicUrl",
"slug": "file-buckets-getpublicurl",
"product": "storage",
"type": "function"
},
"file-buckets-info": {
"id": "file-buckets-info",
"title": "info",
"slug": "file-buckets-info",
"product": "storage",
"type": "function"
},
"file-buckets-list": {
"id": "file-buckets-list",
"title": "list",
"slug": "file-buckets-list",
"product": "storage",
"type": "function"
},
"file-buckets-listbuckets": {
"id": "file-buckets-listbuckets",
"title": "listBuckets",
"slug": "file-buckets-listbuckets",
"product": "storage",
"type": "function"
},
"file-buckets-listv2": {
"id": "file-buckets-listv2",
"title": "listV2",
"slug": "file-buckets-listv2",
"product": "storage",
"type": "function"
},
"file-buckets-move": {
"id": "file-buckets-move",
"title": "move",
"slug": "file-buckets-move",
"product": "storage",
"type": "function"
},
"file-buckets-purgebucketcache": {
"id": "file-buckets-purgebucketcache",
"title": "purgeBucketCache",
"slug": "file-buckets-purgebucketcache",
"product": "storage",
"type": "function"
},
"file-buckets-purgecache": {
"id": "file-buckets-purgecache",
"title": "purgeCache",
"slug": "file-buckets-purgecache",
"product": "storage",
"type": "function"
},
"file-buckets-remove": {
"id": "file-buckets-remove",
"title": "remove",
"slug": "file-buckets-remove",
"product": "storage",
"type": "function"
},
"file-buckets-update": {
"id": "file-buckets-update",
"title": "update",
"slug": "file-buckets-update",
"product": "storage",
"type": "function"
},
"file-buckets-updatebucket": {
"id": "file-buckets-updatebucket",
"title": "updateBucket",
"slug": "file-buckets-updatebucket",
"product": "storage",
"type": "function"
},
"file-buckets-upload": {
"id": "file-buckets-upload",
"title": "upload",
"slug": "file-buckets-upload",
"product": "storage",
"type": "function"
},
"file-buckets-uploadtosignedurl": {
"id": "file-buckets-uploadtosignedurl",
"title": "uploadToSignedUrl",
"slug": "file-buckets-uploadtosignedurl",
"product": "storage",
"type": "function"
},
"vector-buckets": {
"id": "vector-buckets",
"title": "Vector Buckets",
"slug": "vector-buckets",
"type": "function"
},
"vector-buckets-createbucket": {
"id": "vector-buckets-createbucket",
"title": "createBucket",
"slug": "vector-buckets-createbucket",
"product": "storage",
"type": "function"
},
"vector-buckets-createindex": {
"id": "vector-buckets-createindex",
"title": "createIndex",
"slug": "vector-buckets-createindex",
"product": "storage",
"type": "function"
},
"vector-buckets-deletebucket": {
"id": "vector-buckets-deletebucket",
"title": "deleteBucket",
"slug": "vector-buckets-deletebucket",
"product": "storage",
"type": "function"
},
"vector-buckets-deleteindex": {
"id": "vector-buckets-deleteindex",
"title": "deleteIndex",
"slug": "vector-buckets-deleteindex",
"product": "storage",
"type": "function"
},
"vector-buckets-deletevectors": {
"id": "vector-buckets-deletevectors",
"title": "deleteVectors",
"slug": "vector-buckets-deletevectors",
"product": "storage",
"type": "function"
},
"vector-buckets-from": {
"id": "vector-buckets-from",
"title": "from",
"slug": "vector-buckets-from",
"product": "storage",
"type": "function"
},
"vector-buckets-getbucket": {
"id": "vector-buckets-getbucket",
"title": "getBucket",
"slug": "vector-buckets-getbucket",
"product": "storage",
"type": "function"
},
"vector-buckets-getindex": {
"id": "vector-buckets-getindex",
"title": "getIndex",
"slug": "vector-buckets-getindex",
"product": "storage",
"type": "function"
},
"vector-buckets-getvectors": {
"id": "vector-buckets-getvectors",
"title": "getVectors",
"slug": "vector-buckets-getvectors",
"product": "storage",
"type": "function"
},
"vector-buckets-index": {
"id": "vector-buckets-index",
"title": "index",
"slug": "vector-buckets-index",
"product": "storage",
"type": "function"
},
"vector-buckets-listbuckets": {
"id": "vector-buckets-listbuckets",
"title": "listBuckets",
"slug": "vector-buckets-listbuckets",
"product": "storage",
"type": "function"
},
"vector-buckets-listindexes": {
"id": "vector-buckets-listindexes",
"title": "listIndexes",
"slug": "vector-buckets-listindexes",
"product": "storage",
"type": "function"
},
"vector-buckets-listvectors": {
"id": "vector-buckets-listvectors",
"title": "listVectors",
"slug": "vector-buckets-listvectors",
"product": "storage",
"type": "function"
},
"vector-buckets-putvectors": {
"id": "vector-buckets-putvectors",
"title": "putVectors",
"slug": "vector-buckets-putvectors",
"product": "storage",
"type": "function"
},
"vector-buckets-queryvectors": {
"id": "vector-buckets-queryvectors",
"title": "queryVectors",
"slug": "vector-buckets-queryvectors",
"product": "storage",
"type": "function"
}
},
"flat": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
],
"sections": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
{
"type": "category",
"title": "Database",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
{
"id": "using-filters",
"isFunc": false,
"title": "Using filters",
"slug": "using-filters",
"product": "database",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "using-modifiers",
"isFunc": false,
"title": "Using modifiers",
"slug": "using-modifiers",
"product": "database",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
}
]
},
{
"type": "category",
"title": "Auth",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
{
"id": "auth-admin",
"isFunc": false,
"title": "Auth Admin",
"slug": "auth-admin",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "auth-mfa",
"isFunc": false,
"title": "Auth MFA",
"slug": "auth-mfa",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "auth-passkey",
"isFunc": false,
"title": "Auth Passkey",
"slug": "auth-passkey",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "oauth-admin",
"isFunc": false,
"title": "OAuth Admin",
"slug": "oauth-admin",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "oauth-server",
"isFunc": false,
"title": "OAuth Server",
"slug": "oauth-server",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "passkey-admin",
"isFunc": false,
"title": "Passkey Admin",
"slug": "passkey-admin",
"product": "auth",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]"
]
}
]
},
{
"type": "category",
"title": "Edge Functions",
"items": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"type": "category",
"title": "Realtime",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"type": "category",
"title": "Storage",
"items": [
{
"id": "analytics-buckets",
"isFunc": false,
"title": "Analytics Buckets",
"slug": "analytics-buckets",
"product": "storage",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "file-buckets",
"isFunc": false,
"title": "File Buckets",
"slug": "file-buckets",
"product": "storage",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
},
{
"id": "vector-buckets",
"isFunc": false,
"title": "Vector Buckets",
"slug": "vector-buckets",
"product": "storage",
"type": "function",
"items": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
}
]
}
],
"functionsList": [
{
"id": "initializing",
"$ref": "@supabase/supabase-js.SupabaseClient.constructor"
},
{
"id": "delete",
"$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.delete"
},
{
"id": "from",
"$ref": "@supabase/postgrest-js.PostgrestClient.from"
},
{
"id": "insert",
"$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.insert"
},
{
"id": "rpc",
"$ref": "@supabase/postgrest-js.PostgrestClient.rpc"
},
{
"id": "schema",
"$ref": "@supabase/postgrest-js.PostgrestClient.schema"
},
{
"id": "select",
"$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.select"
},
{
"id": "update",
"$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.update"
},
{
"id": "upsert",
"$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.upsert"
},
{
"id": "using-filters",
"title": "Using Filters",
"description": "Filters allow you to only return rows that match certain conditions.\n\nFilters can be used on `select()`, `update()`, `upsert()`, and `delete()` queries.\n\nIf a Postgres function returns a table response, you can also apply filters.\n",
"examples": [
{
"id": "applying-filters",
"name": "Applying Filters",
"description": "Filters must be applied after any of `select()`, `update()`, `upsert()`,\n`delete()`, and `rpc()` and before\n[modifiers](/docs/reference/javascript/using-modifiers).\n",
"code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, section_id')\n .eq('name', 'violin') // Correct\n\nconst { data, error } = await supabase\n .from('instruments')\n .eq('name', 'violin') // Incorrect\n .select('name, section_id')\n```\n"
},
{
"id": "chaining-filters",
"name": "Chaining",
"description": "Filters can be chained together to produce advanced queries. For example,\nto query cities with population between 1,000 and 10,000:\n\n```ts\nconst { data, error } = await supabase\n .from('cities')\n .select('name, country_id')\n .gte('population', 1000)\n .lt('population', 10000)\n```\n",
"code": "```ts\nconst { data, error } = await supabase\n .from('cities')\n .select('name, country_id')\n .gte('population', 1000)\n .lt('population', 10000)\n```\n"
},
{
"id": "conditional-chaining",
"name": "Conditional Chaining",
"description": "Filters can be built up one step at a time and then executed. For example:\n\n```ts\nconst filterByName = null\nconst filterPopLow = 1000\nconst filterPopHigh = 10000\n\nlet query = supabase\n .from('cities')\n .select('name, country_id')\n\nif (filterByName) { query = query.eq('name', filterByName) }\nif (filterPopLow) { query = query.gte('population', filterPopLow) }\nif (filterPopHigh) { query = query.lt('population', filterPopHigh) }\n\nconst { data, error } = await query\n```\n",
"code": "```ts\nconst filterByName = null\nconst filterPopLow = 1000\nconst filterPopHigh = 10000\n\nlet query = supabase\n .from('cities')\n .select('name, country_id')\n\nif (filterByName) { query = query.eq('name', filterByName) }\nif (filterPopLow) { query = query.gte('population', filterPopLow) }\nif (filterPopHigh) { query = query.lt('population', filterPopHigh) }\n\nconst { data, error } = await query\n```\n"
},
{
"id": "filter-by-value-within-json-column",
"name": "Filter by values within a JSON column",
"code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select()\n .eq('address->postcode', 90210)\n```\n",
"data": {
"sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210 }'),\n (2, 'Jane', null);\n```\n"
},
"response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n"
},
{
"id": "filter-referenced-tables",
"name": "Filter referenced tables",
"code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .eq('instruments.name', 'flute')\n```\n",
"data": {
"sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```\n",
"response": "```json\n{\n \"data\": [\n {\n \"name\": \"woodwinds\",\n \"characters\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n"
},
"description": "You can filter on referenced tables in your `select()` query using dot\nnotation.\n"
}
]
},
{
"id": "using-filters-containedby",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy"
},
{
"id": "using-filters-contains",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.contains"
},
{
"id": "using-filters-eq",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.eq"
},
{
"id": "using-filters-filter",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.filter"
},
{
"id": "using-filters-gt",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gt"
},
{
"id": "using-filters-gte",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gte"
},
{
"id": "using-filters-ilike",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike"
},
{
"id": "using-filters-ilikeallof",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf"
},
{
"id": "using-filters-ilikeanyof",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf"
},
{
"id": "using-filters-in",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.in"
},
{
"id": "using-filters-is",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.is"
},
{
"id": "using-filters-like",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.like"
},
{
"id": "using-filters-likeallof",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf"
},
{
"id": "using-filters-likeanyof",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf"
},
{
"id": "using-filters-lt",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lt"
},
{
"id": "using-filters-lte",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lte"
},
{
"id": "using-filters-match",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.match"
},
{
"id": "using-filters-neq",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.neq"
},
{
"id": "using-filters-not",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.not"
},
{
"id": "using-filters-or",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.or"
},
{
"id": "using-filters-overlaps",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps"
},
{
"id": "using-filters-rangeadjacent",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent"
},
{
"id": "using-filters-rangegt",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt"
},
{
"id": "using-filters-rangegte",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte"
},
{
"id": "using-filters-rangelt",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt"
},
{
"id": "using-filters-rangelte",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte"
},
{
"id": "using-filters-textsearch",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch"
},
{
"id": "using-modifiers",
"title": "Using modifiers",
"description": "Filters work on the row level—they allow you to return rows that only match certain conditions without changing the shape of the rows. Modifiers are everything that don't fit that definition—allowing you to change the format of the response (e.g., returning a CSV string).\n\nModifiers must be specified after filters. Some modifiers only apply for queries that return rows (e.g., `select()` or `rpc()` on a function that returns a table response)."
},
{
"id": "using-modifiers-abortsignal",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal"
},
{
"id": "using-modifiers-csv",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.csv"
},
{
"id": "using-modifiers-explain",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.explain"
},
{
"id": "using-modifiers-geojson",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson"
},
{
"id": "using-modifiers-limit",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.limit"
},
{
"id": "using-modifiers-maxaffected",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected"
},
{
"id": "using-modifiers-maybesingle",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle"
},
{
"id": "using-modifiers-order",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.order"
},
{
"id": "using-modifiers-overridetypes",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.overrideTypes"
},
{
"id": "using-modifiers-range",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.range"
},
{
"id": "using-modifiers-retry",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.retry"
},
{
"id": "using-modifiers-returns",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.returns"
},
{
"id": "using-modifiers-rollback",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback"
},
{
"id": "using-modifiers-select",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.select"
},
{
"id": "using-modifiers-setheader",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.setHeader"
},
{
"id": "using-modifiers-single",
"$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.single"
},
{
"id": "using-modifiers-stripnulls",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.stripNulls"
},
{
"id": "using-modifiers-throwonerror",
"$ref": "@supabase/postgrest-js.PostgrestBuilder.throwOnError"
},
{
"id": "auth",
"title": "Overview",
"notes": "- The auth methods can be accessed via the `supabase.auth` namespace.\n- By default, the supabase client sets `persistSession` to true and attempts to store the session in local storage. When using the supabase client in an environment that doesn't support local storage, you might notice the following warning message being logged:\n\n > No storage option exists to persist the session, which may result in unexpected behavior when using auth. If you want to set `persistSession` to true, please provide a storage option or you may set `persistSession` to false to disable this warning.\n\n This warning message can be safely ignored if you're not using auth on the server-side. If you are using auth and you want to set `persistSession` to true, you will need to provide a custom storage implementation that follows [this interface](https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/src/lib/types.ts#L1053).\n- Any email links and one-time passwords (OTPs) sent have a default expiry of 24 hours. We have the following [rate limits](/docs/guides/deployment/going-into-prod#auth-rate-limits) in place to guard against brute force attacks.\n- The expiry of an access token can be set in the \"JWT expiry limit\" field in [your project's auth settings](/dashboard/project/_/auth/providers). A refresh token never expires and can only be used once.\n",
"examples": [
{
"id": "create-auth-client",
"name": "Create auth client",
"isSpotlight": true,
"code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, publishable_key)\n```\n"
},
{
"id": "create-auth-client-server-side",
"name": "Create auth client (server-side)",
"isSpotlight": false,
"code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, publishable_key, {\n auth: {\n autoRefreshToken: false,\n persistSession: false,\n detectSessionInUrl: false\n }\n})\n```\n"
}
]
},
{
"id": "auth-dispose",
"$ref": "@supabase/auth-js.GoTrueClient.dispose"
},
{
"id": "auth-exchangecodeforsession",
"$ref": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession"
},
{
"id": "auth-getclaims",
"$ref": "@supabase/auth-js.GoTrueClient.getClaims"
},
{
"id": "auth-getsession",
"$ref": "@supabase/auth-js.GoTrueClient.getSession"
},
{
"id": "auth-getuser",
"$ref": "@supabase/auth-js.GoTrueClient.getUser"
},
{
"id": "auth-getuseridentities",
"$ref": "@supabase/auth-js.GoTrueClient.getUserIdentities"
},
{
"id": "auth-initialize",
"$ref": "@supabase/auth-js.GoTrueClient.initialize"
},
{
"id": "auth-linkidentity",
"$ref": "@supabase/auth-js.GoTrueClient.linkIdentity"
},
{
"id": "auth-onauthstatechange",
"$ref": "@supabase/auth-js.GoTrueClient.onAuthStateChange"
},
{
"id": "auth-reauthenticate",
"$ref": "@supabase/auth-js.GoTrueClient.reauthenticate"
},
{
"id": "auth-refreshsession",
"$ref": "@supabase/auth-js.GoTrueClient.refreshSession"
},
{
"id": "auth-registerpasskey",
"$ref": "@supabase/auth-js.GoTrueClient.registerPasskey"
},
{
"id": "auth-resend",
"$ref": "@supabase/auth-js.GoTrueClient.resend"
},
{
"id": "auth-resetpasswordforemail",
"$ref": "@supabase/auth-js.GoTrueClient.resetPasswordForEmail"
},
{
"id": "auth-setsession",
"$ref": "@supabase/auth-js.GoTrueClient.setSession"
},
{
"id": "auth-signinanonymously",
"$ref": "@supabase/auth-js.GoTrueClient.signInAnonymously"
},
{
"id": "auth-signinwithidtoken",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithIdToken"
},
{
"id": "auth-signinwithoauth",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithOAuth"
},
{
"id": "auth-signinwithotp",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithOtp"
},
{
"id": "auth-signinwithpasskey",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithPasskey"
},
{
"id": "auth-signinwithpassword",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithPassword"
},
{
"id": "auth-signinwithsso",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithSSO"
},
{
"id": "auth-signinwithweb3",
"$ref": "@supabase/auth-js.GoTrueClient.signInWithWeb3"
},
{
"id": "auth-signout",
"$ref": "@supabase/auth-js.GoTrueClient.signOut"
},
{
"id": "auth-signup",
"$ref": "@supabase/auth-js.GoTrueClient.signUp"
},
{
"id": "auth-startautorefresh",
"$ref": "@supabase/auth-js.GoTrueClient.startAutoRefresh"
},
{
"id": "auth-stopautorefresh",
"$ref": "@supabase/auth-js.GoTrueClient.stopAutoRefresh"
},
{
"id": "auth-unlinkidentity",
"$ref": "@supabase/auth-js.GoTrueClient.unlinkIdentity"
},
{
"id": "auth-updateuser",
"$ref": "@supabase/auth-js.GoTrueClient.updateUser"
},
{
"id": "auth-verifyotp",
"$ref": "@supabase/auth-js.GoTrueClient.verifyOtp"
},
{
"id": "auth-admin",
"title": "Overview",
"notes": "- Any method under the `supabase.auth.admin` namespace requires a `secret` key.\n- These methods are considered admin methods and should be called on a trusted server. Never expose your `secret` key in the browser.\n",
"examples": [
{
"id": "create-auth-admin-client",
"name": "Create server-side auth client",
"isSpotlight": true,
"code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, secret_key, {\n auth: {\n autoRefreshToken: false,\n persistSession: false\n }\n})\n\n// Access auth admin api\nconst adminAuthClient = supabase.auth.admin\n```\n"
}
]
},
{
"id": "auth-admin-createprovider",
"$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider"
},
{
"id": "auth-admin-createuser",
"$ref": "@supabase/auth-js.GoTrueAdminApi.createUser"
},
{
"id": "auth-admin-deletefactor",
"$ref": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor"
},
{
"id": "auth-admin-deleteprovider",
"$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider"
},
{
"id": "auth-admin-deleteuser",
"$ref": "@supabase/auth-js.GoTrueAdminApi.deleteUser"
},
{
"id": "auth-admin-generatelink",
"$ref": "@supabase/auth-js.GoTrueAdminApi.generateLink"
},
{
"id": "auth-admin-getprovider",
"$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider"
},
{
"id": "auth-admin-getuserbyid",
"$ref": "@supabase/auth-js.GoTrueAdminApi.getUserById"
},
{
"id": "auth-admin-inviteuserbyemail",
"$ref": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail"
},
{
"id": "auth-admin-listfactors",
"$ref": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors"
},
{
"id": "auth-admin-listproviders",
"$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders"
},
{
"id": "auth-admin-listusers",
"$ref": "@supabase/auth-js.GoTrueAdminApi.listUsers"
},
{
"id": "auth-admin-signout",
"$ref": "@supabase/auth-js.GoTrueAdminApi.signOut"
},
{
"id": "auth-admin-updateprovider",
"$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider"
},
{
"id": "auth-admin-updateuserbyid",
"$ref": "@supabase/auth-js.GoTrueAdminApi.updateUserById"
},
{
"id": "auth-mfa",
"title": "Auth MFA",
"description": "This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `supabase.auth.mfa` namespace.\n\nCurrently, there is support for time-based one-time password (TOTP) and phone verification code as the 2nd factor. Recovery codes are not supported but users can enroll multiple factors, with an upper limit of 10.\n\nHaving a 2nd factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup factor.\n\nLearn more about implementing MFA in your application [in the MFA guide](https://supabase.com/docs/guides/auth/auth-mfa#overview)."
},
{
"id": "auth-mfa-challenge",
"$ref": "@supabase/auth-js.GoTrueMFAApi.challenge"
},
{
"id": "auth-mfa-challengeandverify",
"$ref": "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify"
},
{
"id": "auth-mfa-enroll",
"$ref": "@supabase/auth-js.GoTrueMFAApi.enroll"
},
{
"id": "auth-mfa-getauthenticatorassurancelevel",
"$ref": "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel"
},
{
"id": "auth-mfa-listfactors",
"$ref": "@supabase/auth-js.GoTrueMFAApi.listFactors"
},
{
"id": "auth-mfa-unenroll",
"$ref": "@supabase/auth-js.GoTrueMFAApi.unenroll"
},
{
"id": "auth-mfa-verify",
"$ref": "@supabase/auth-js.GoTrueMFAApi.verify"
},
{
"id": "auth-passkey",
"title": "Auth Passkey",
"description": "This section contains methods for WebAuthn passkey registration, authentication, and management. Methods are invoked behind the `supabase.auth.passkey` namespace.\n\nPasskey support is an experimental feature. Enable it when creating the client:",
"code": "```js\nconst supabase = createClient(supabaseUrl, publishableKey, {\n auth: {\n experimental: { passkey: true },\n },\n})\n```"
},
{
"id": "auth-passkey-delete",
"$ref": "@supabase/auth-js.AuthPasskeyApi.delete"
},
{
"id": "auth-passkey-list",
"$ref": "@supabase/auth-js.AuthPasskeyApi.list"
},
{
"id": "auth-passkey-startauthentication",
"$ref": "@supabase/auth-js.AuthPasskeyApi.startAuthentication"
},
{
"id": "auth-passkey-startregistration",
"$ref": "@supabase/auth-js.AuthPasskeyApi.startRegistration"
},
{
"id": "auth-passkey-update",
"$ref": "@supabase/auth-js.AuthPasskeyApi.update"
},
{
"id": "auth-passkey-verifyauthentication",
"$ref": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication"
},
{
"id": "auth-passkey-verifyregistration",
"$ref": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration"
},
{
"id": "oauth-admin",
"title": "OAuth Admin",
"description": "The OAuth Admin API allows you to manage OAuth clients programmatically. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. These functions should only be called on a server. Never expose your `secret` key in the browser."
},
{
"id": "oauth-admin-createclient",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient"
},
{
"id": "oauth-admin-deleteclient",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient"
},
{
"id": "oauth-admin-getclient",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient"
},
{
"id": "oauth-admin-listclients",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients"
},
{
"id": "oauth-admin-regenerateclientsecret",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret"
},
{
"id": "oauth-admin-updateclient",
"$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient"
},
{
"id": "oauth-server",
"title": "OAuth Server",
"description": "The OAuth Server API allows you to build custom OAuth consent screens for your application. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth."
},
{
"id": "oauth-server-approveauthorization",
"$ref": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization"
},
{
"id": "oauth-server-denyauthorization",
"$ref": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization"
},
{
"id": "oauth-server-getauthorizationdetails",
"$ref": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails"
},
{
"id": "oauth-server-listgrants",
"$ref": "@supabase/auth-js.AuthOAuthServerApi.listGrants"
},
{
"id": "oauth-server-revokegrant",
"$ref": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant"
},
{
"id": "passkey-admin",
"title": "Passkey admin",
"description": "Contains passkey administration methods. Requires a secret key."
},
{
"id": "passkey-admin-deletepasskey",
"$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey"
},
{
"id": "passkey-admin-listpasskeys",
"$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys"
},
{
"id": "functions-corsheaders",
"$ref": "@supabase/supabase-js.cors.corsHeaders"
},
{
"id": "functions-invoke",
"$ref": "@supabase/functions-js.FunctionsClient.invoke"
},
{
"id": "functions-setauth",
"$ref": "@supabase/functions-js.FunctionsClient.setAuth"
},
{
"id": "channel",
"$ref": "@supabase/realtime-js.RealtimeClient.channel"
},
{
"id": "connect",
"$ref": "@supabase/realtime-js.RealtimeClient.connect"
},
{
"id": "connectionstate",
"$ref": "@supabase/realtime-js.RealtimeClient.connectionState"
},
{
"id": "disconnect",
"$ref": "@supabase/realtime-js.RealtimeClient.disconnect"
},
{
"id": "endpointurl",
"$ref": "@supabase/realtime-js.RealtimeClient.endpointURL"
},
{
"id": "getchannels",
"$ref": "@supabase/realtime-js.RealtimeClient.getChannels"
},
{
"id": "getwebsocketconstructor",
"$ref": "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor"
},
{
"id": "httpsend",
"$ref": "@supabase/realtime-js.RealtimeChannel.httpSend"
},
{
"id": "isconnected",
"$ref": "@supabase/realtime-js.RealtimeClient.isConnected"
},
{
"id": "isconnecting",
"$ref": "@supabase/realtime-js.RealtimeClient.isConnecting"
},
{
"id": "isdisconnecting",
"$ref": "@supabase/realtime-js.RealtimeClient.isDisconnecting"
},
{
"id": "iswebsocketsupported",
"$ref": "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported"
},
{
"id": "log",
"$ref": "@supabase/realtime-js.RealtimeClient.log"
},
{
"id": "on",
"$ref": "@supabase/realtime-js.RealtimeChannel.on"
},
{
"id": "onheartbeat",
"$ref": "@supabase/realtime-js.RealtimeClient.onHeartbeat"
},
{
"id": "presencestate",
"$ref": "@supabase/realtime-js.RealtimeChannel.presenceState"
},
{
"id": "push",
"$ref": "@supabase/realtime-js.RealtimeClient.push"
},
{
"id": "removeallchannels",
"$ref": "@supabase/realtime-js.RealtimeClient.removeAllChannels"
},
{
"id": "removechannel",
"$ref": "@supabase/realtime-js.RealtimeClient.removeChannel"
},
{
"id": "send",
"$ref": "@supabase/realtime-js.RealtimeChannel.send"
},
{
"id": "sendheartbeat",
"$ref": "@supabase/realtime-js.RealtimeClient.sendHeartbeat"
},
{
"id": "setauth",
"$ref": "@supabase/realtime-js.RealtimeClient.setAuth"
},
{
"id": "subscribe",
"$ref": "@supabase/realtime-js.RealtimeChannel.subscribe"
},
{
"id": "teardown",
"$ref": "@supabase/realtime-js.RealtimeChannel.teardown"
},
{
"id": "track",
"$ref": "@supabase/realtime-js.RealtimeChannel.track"
},
{
"id": "unsubscribe",
"$ref": "@supabase/realtime-js.RealtimeChannel.unsubscribe"
},
{
"id": "untrack",
"$ref": "@supabase/realtime-js.RealtimeChannel.untrack"
},
{
"id": "updatejoinpayload",
"$ref": "@supabase/realtime-js.RealtimeChannel.updateJoinPayload"
},
{
"id": "analytics-buckets",
"title": "Analytics Buckets",
"description": "This section contains methods for working with Analytics Buckets."
},
{
"id": "analytics-buckets-createbucket",
"$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket"
},
{
"id": "analytics-buckets-deletebucket",
"$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket"
},
{
"id": "analytics-buckets-from",
"$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from"
},
{
"id": "analytics-buckets-listbuckets",
"$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets"
},
{
"id": "file-buckets",
"title": "File Buckets",
"description": "This section contains methods for working with File Buckets."
},
{
"id": "file-buckets-copy",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.copy"
},
{
"id": "file-buckets-createbucket",
"$ref": "@supabase/storage-js.StorageClient.createBucket"
},
{
"id": "file-buckets-createsigneduploadurl",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl"
},
{
"id": "file-buckets-createsignedurl",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl"
},
{
"id": "file-buckets-createsignedurls",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls"
},
{
"id": "file-buckets-deletebucket",
"$ref": "@supabase/storage-js.StorageClient.deleteBucket"
},
{
"id": "file-buckets-download",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.download"
},
{
"id": "file-buckets-emptybucket",
"$ref": "@supabase/storage-js.StorageClient.emptyBucket"
},
{
"id": "file-buckets-exists",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.exists"
},
{
"id": "file-buckets-from",
"$ref": "@supabase/storage-js.StorageClient.from"
},
{
"id": "file-buckets-getbucket",
"$ref": "@supabase/storage-js.StorageClient.getBucket"
},
{
"id": "file-buckets-getpublicurl",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl"
},
{
"id": "file-buckets-info",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.info"
},
{
"id": "file-buckets-list",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.list"
},
{
"id": "file-buckets-listbuckets",
"$ref": "@supabase/storage-js.StorageClient.listBuckets"
},
{
"id": "file-buckets-listv2",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.listV2"
},
{
"id": "file-buckets-move",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.move"
},
{
"id": "file-buckets-purgebucketcache",
"$ref": "@supabase/storage-js.StorageClient.purgeBucketCache"
},
{
"id": "file-buckets-purgecache",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.purgeCache"
},
{
"id": "file-buckets-remove",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.remove"
},
{
"id": "file-buckets-update",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.update"
},
{
"id": "file-buckets-updatebucket",
"$ref": "@supabase/storage-js.StorageClient.updateBucket"
},
{
"id": "file-buckets-upload",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.upload"
},
{
"id": "file-buckets-uploadtosignedurl",
"$ref": "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl"
},
{
"id": "vector-buckets",
"title": "Vector Buckets",
"description": "This section contains methods for working with Vector Buckets."
},
{
"id": "vector-buckets-createbucket",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket"
},
{
"id": "vector-buckets-createindex",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex"
},
{
"id": "vector-buckets-deletebucket",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket"
},
{
"id": "vector-buckets-deleteindex",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex"
},
{
"id": "vector-buckets-deletevectors",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors"
},
{
"id": "vector-buckets-from",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from"
},
{
"id": "vector-buckets-getbucket",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket"
},
{
"id": "vector-buckets-getindex",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex"
},
{
"id": "vector-buckets-getvectors",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors"
},
{
"id": "vector-buckets-index",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope"
},
{
"id": "vector-buckets-listbuckets",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets"
},
{
"id": "vector-buckets-listindexes",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes"
},
{
"id": "vector-buckets-listvectors",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors"
},
{
"id": "vector-buckets-putvectors",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors"
},
{
"id": "vector-buckets-queryvectors",
"$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors"
}
],
"typeSpec": {
"methods": {
"@supabase/functions-js.FunctionsClient.constructor": {
"name": "@supabase/functions-js.FunctionsClient.constructor",
"params": [
{
"name": "url",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"type": {
"type": "object",
"properties": [
{
"name": "customFetch",
"type": {
"type": "function",
"params": [
{
"name": "input",
"type": {
"type": "union",
"subTypes": [
{
"type": "nameOnly",
"name": "RequestInfo"
},
{
"type": "nameOnly",
"name": "URL"
}
]
}
},
{
"name": "init",
"type": {
"type": "nameOnly",
"name": "RequestInit"
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "nameOnly",
"name": "Response"
}
}
},
"comment": {
"shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
},
"isOptional": true
},
{
"name": "headers",
"type": {
"type": "record",
"name": "Record",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true
},
{
"name": "region",
"type": {
"type": "nameOnly",
"name": "FunctionRegion"
},
"isOptional": true
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "FunctionsClient"
}
},
"comment": {
"shortText": "Creates a new Functions client bound to an Edge Functions URL.",
"examples": [
{
"id": "using-supabase-js-recommended",
"name": "Using supabase-js (recommended)",
"code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.functions.invoke('hello-world')\n```"
},
{
"id": "standalone-import-for-bundle-sensitive-environments",
"name": "Standalone import for bundle-sensitive environments",
"code": "```ts\nimport { FunctionsClient, FunctionRegion } from '@supabase/functions-js'\n\nconst functions = new FunctionsClient('https://xyzcompany.supabase.co/functions/v1', {\n headers: { apikey: 'your-publishable-key' },\n region: FunctionRegion.UsEast1,\n})\n```"
}
]
}
},
"@supabase/functions-js.FunctionsClient.invoke": {
"name": "@supabase/functions-js.FunctionsClient.invoke",
"params": [
{
"name": "functionName",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The name of the Function to invoke."
}
},
{
"name": "options",
"type": {
"name": "FunctionInvokeOptions",
"type": "object",
"properties": [
{
"name": "body",
"type": {
"type": "union",
"subTypes": [
{
"type": "nameOnly",
"name": "File"
},
{
"type": "nameOnly",
"name": "Blob"
},
{
"type": "nameOnly",
"name": "ArrayBuffer"
},
{
"type": "nameOnly",
"name": "FormData"
},
{
"type": "nameOnly",
"name": "ReadableStream"
},
{
"type": "record",
"name": "Record",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "any"
}
},
{
"type": "intrinsic",
"name": "string"
}
]
},
"isOptional": true,
"comment": {
"shortText": "The body of the request."
}
},
{
"name": "headers",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true,
"comment": {
"shortText": "Object representing the headers to send with the request."
}
},
{
"name": "method",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "POST"
},
{
"type": "literal",
"value": "GET"
},
{
"type": "literal",
"value": "PUT"
},
{
"type": "literal",
"value": "PATCH"
},
{
"type": "literal",
"value": "DELETE"
}
]
},
"isOptional": true,
"comment": {
"shortText": "The HTTP verb of the request"
}
},
{
"name": "region",
"type": {
"type": "nameOnly",
"name": "FunctionRegion"
},
"isOptional": true,
"comment": {
"shortText": "The Region to invoke the function in."
}
},
{
"name": "signal",
"type": {
"type": "nameOnly",
"name": "AbortSignal"
},
"isOptional": true,
"comment": {
"shortText": "The AbortSignal to use for the request."
}
},
{
"name": "timeout",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true,
"comment": {
"shortText": "The timeout for the request in milliseconds.\nIf the function takes longer than this, the request will be aborted."
}
}
]
},
"comment": {
"shortText": "Options for invoking the Function."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "FunctionsResponse",
"subTypes": [
{
"type": "nameOnly",
"name": "FunctionsResponseSuccess"
},
{
"type": "nameOnly",
"name": "FunctionsResponseFailure"
}
]
}
}
},
"comment": {
"shortText": "Invokes a function",
"text": "- Requires an Authorization header.\n- Invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.\n- When you pass in a body to your function, we automatically attach the Content-Type header for `Blob`, `ArrayBuffer`, `File`, `FormData` and `String`. If it doesn't match any of these types we assume the payload is `json`, serialize it and attach the `Content-Type` header as `application/json`. You can override this behavior by passing in a `Content-Type` header of your own.\n- Responses are automatically parsed as `json`, `blob` and `form-data` depending on the `Content-Type` header sent by your function. Responses are parsed as `text` by default.",
"examples": [
{
"id": "example-1",
"name": "Example 1",
"code": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```"
},
{
"id": "basic-invocation",
"name": "Basic invocation",
"code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' }\n})\n```"
},
{
"id": "error-handling",
"name": "Error handling",
"code": "```js\nimport { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from \"@supabase/supabase-js\";\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n\nif (error instanceof FunctionsHttpError) {\n const errorMessage = await error.context.json()\n console.error('Function returned an error', errorMessage)\n} else if (error instanceof FunctionsRelayError) {\n console.error('Relay error:', error)\n} else if (error instanceof FunctionsFetchError) {\n console.error('Fetch error:', error)\n}\n```",
"description": "A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function. Log the full error object so fields like `name`, `context`, and any structured body aren't hidden."
},
{
"id": "passing-custom-headers",
"name": "Passing custom headers",
"code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n```",
"description": "You can pass custom headers to your function. Note: supabase-js automatically passes the `Authorization` header with the signed in user's JWT."
},
{
"id": "calling-with-delete-http-verb",
"name": "Calling with DELETE HTTP verb",
"code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' },\n method: 'DELETE'\n})\n```",
"description": "You can also set the HTTP verb to `DELETE` when calling your Edge Function."
},
{
"id": "invoking-a-function-in-the-useast1-region",
"name": "Invoking a Function in the UsEast1 region",
"code": "```js\nimport { createClient, FunctionRegion } from '@supabase/supabase-js'\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' },\n region: FunctionRegion.UsEast1\n})\n```",
"description": "Here are the available regions:\n- `FunctionRegion.Any`\n- `FunctionRegion.ApNortheast1`\n- `FunctionRegion.ApNortheast2`\n- `FunctionRegion.ApSouth1`\n- `FunctionRegion.ApSoutheast1`\n- `FunctionRegion.ApSoutheast2`\n- `FunctionRegion.CaCentral1`\n- `FunctionRegion.EuCentral1`\n- `FunctionRegion.EuWest1`\n- `FunctionRegion.EuWest2`\n- `FunctionRegion.EuWest3`\n- `FunctionRegion.SaEast1`\n- `FunctionRegion.UsEast1`\n- `FunctionRegion.UsWest1`\n- `FunctionRegion.UsWest2`"
},
{
"id": "calling-with-get-http-verb",
"name": "Calling with GET HTTP verb",
"code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n method: 'GET'\n})\n```",
"description": "You can also set the HTTP verb to `GET` when calling your Edge Function."
},
{
"id": "standalone-client-invoke",
"name": "Standalone client invoke",
"code": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```"
}
]
}
},
"@supabase/functions-js.FunctionsClient.setAuth": {
"name": "@supabase/functions-js.FunctionsClient.setAuth",
"params": [
{
"name": "token",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "the new jwt token sent in the authorisation header"
}
}
],
"ret": {
"type": {
"type": "intrinsic",
"name": "void"
}
},
"comment": {
"shortText": "Updates the authorization header",
"examples": [
{
"id": "setting-the-authorization-header",
"name": "Setting the authorization header",
"code": "```ts\nfunctions.setAuth(session.access_token)\n```"
}
]
}
},
"@supabase/functions-js.FunctionsError.constructor": {
"name": "@supabase/functions-js.FunctionsError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "FunctionsError"
}
}
},
"@supabase/functions-js.FunctionsError.toJSON": {
"name": "@supabase/functions-js.FunctionsError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
},
"@supabase/functions-js.FunctionsFetchError.constructor": {
"name": "@supabase/functions-js.FunctionsFetchError.constructor",
"params": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "FunctionsFetchError"
}
}
},
"@supabase/functions-js.FunctionsFetchError.toJSON": {
"name": "@supabase/functions-js.FunctionsFetchError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
},
"@supabase/functions-js.FunctionsHttpError.constructor": {
"name": "@supabase/functions-js.FunctionsHttpError.constructor",
"params": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "FunctionsHttpError"
}
}
},
"@supabase/functions-js.FunctionsHttpError.toJSON": {
"name": "@supabase/functions-js.FunctionsHttpError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
},
"@supabase/functions-js.FunctionsRelayError.constructor": {
"name": "@supabase/functions-js.FunctionsRelayError.constructor",
"params": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "FunctionsRelayError"
}
}
},
"@supabase/functions-js.FunctionsRelayError.toJSON": {
"name": "@supabase/functions-js.FunctionsRelayError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "context",
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
},
"@supabase/auth-js.AuthApiError.constructor": {
"name": "@supabase/auth-js.AuthApiError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "intrinsic",
"name": "number"
}
},
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "string"
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthApiError"
}
}
},
"@supabase/auth-js.AuthApiError.toJSON": {
"name": "@supabase/auth-js.AuthApiError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthError.constructor": {
"name": "@supabase/auth-js.AuthError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true
},
{
"name": "code",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
},
"@supabase/auth-js.AuthError.toJSON": {
"name": "@supabase/auth-js.AuthError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthImplicitGrantRedirectError.constructor": {
"name": "@supabase/auth-js.AuthImplicitGrantRedirectError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "details",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "error",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthImplicitGrantRedirectError"
}
}
},
"@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON": {
"name": "@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "details",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "error",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthInvalidCredentialsError.constructor": {
"name": "@supabase/auth-js.AuthInvalidCredentialsError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthInvalidCredentialsError"
}
}
},
"@supabase/auth-js.AuthInvalidCredentialsError.toJSON": {
"name": "@supabase/auth-js.AuthInvalidCredentialsError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthInvalidJwtError.constructor": {
"name": "@supabase/auth-js.AuthInvalidJwtError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthInvalidJwtError"
}
}
},
"@supabase/auth-js.AuthInvalidJwtError.toJSON": {
"name": "@supabase/auth-js.AuthInvalidJwtError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthInvalidTokenResponseError.constructor": {
"name": "@supabase/auth-js.AuthInvalidTokenResponseError.constructor",
"params": [],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthInvalidTokenResponseError"
}
}
},
"@supabase/auth-js.AuthInvalidTokenResponseError.toJSON": {
"name": "@supabase/auth-js.AuthInvalidTokenResponseError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor": {
"name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor",
"params": [],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthPKCECodeVerifierMissingError"
}
}
},
"@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON": {
"name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor": {
"name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "details",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "error",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthPKCEGrantCodeExchangeError"
}
}
},
"@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON": {
"name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "details",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "error",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthRefreshDiscardedError.constructor": {
"name": "@supabase/auth-js.AuthRefreshDiscardedError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthRefreshDiscardedError"
}
}
},
"@supabase/auth-js.AuthRefreshDiscardedError.toJSON": {
"name": "@supabase/auth-js.AuthRefreshDiscardedError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthRetryableFetchError.constructor": {
"name": "@supabase/auth-js.AuthRetryableFetchError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "intrinsic",
"name": "number"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthRetryableFetchError"
}
}
},
"@supabase/auth-js.AuthRetryableFetchError.toJSON": {
"name": "@supabase/auth-js.AuthRetryableFetchError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthSessionMissingError.constructor": {
"name": "@supabase/auth-js.AuthSessionMissingError.constructor",
"params": [],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthSessionMissingError"
}
}
},
"@supabase/auth-js.AuthSessionMissingError.toJSON": {
"name": "@supabase/auth-js.AuthSessionMissingError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthUnknownError.constructor": {
"name": "@supabase/auth-js.AuthUnknownError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "originalError",
"type": {
"type": "intrinsic",
"name": "unknown"
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthUnknownError"
}
}
},
"@supabase/auth-js.AuthUnknownError.toJSON": {
"name": "@supabase/auth-js.AuthUnknownError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.AuthWeakPasswordError.constructor": {
"name": "@supabase/auth-js.AuthWeakPasswordError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "intrinsic",
"name": "number"
}
},
{
"name": "reasons",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "length"
},
{
"type": "literal",
"value": "characters"
},
{
"type": "literal",
"value": "pwned"
}
]
}
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "AuthWeakPasswordError"
}
}
},
"@supabase/auth-js.AuthWeakPasswordError.toJSON": {
"name": "@supabase/auth-js.AuthWeakPasswordError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "reasons",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "length"
},
{
"type": "literal",
"value": "characters"
},
{
"type": "literal",
"value": "pwned"
}
]
}
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.CustomAuthError.constructor": {
"name": "@supabase/auth-js.CustomAuthError.constructor",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "intrinsic",
"name": "number"
}
},
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "string"
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "CustomAuthError"
}
}
},
"@supabase/auth-js.CustomAuthError.toJSON": {
"name": "@supabase/auth-js.CustomAuthError.toJSON",
"params": [],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "code",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
null,
{
"type": "nameOnly",
"name": "ErrorCode"
}
]
}
},
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "undefined"
},
{
"type": "intrinsic",
"name": "number"
}
]
}
}
]
}
}
},
"@supabase/auth-js.GoTrueAdminApi.constructor": {
"name": "@supabase/auth-js.GoTrueAdminApi.constructor",
"params": [
{
"type": {
"type": "object",
"properties": [
{
"name": "experimental",
"type": {
"name": "ExperimentalFeatureFlags",
"type": "object",
"properties": [
{
"name": "passkey",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time."
}
}
]
},
"isOptional": true
},
{
"name": "fetch",
"type": {
"type": "function",
"params": [
{
"name": "input",
"type": {
"type": "union",
"subTypes": [
{
"type": "nameOnly",
"name": "URL"
},
{
"type": "nameOnly",
"name": "RequestInfo"
}
]
}
},
{
"name": "init",
"type": {
"type": "nameOnly",
"name": "RequestInit"
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "nameOnly",
"name": "Response"
}
}
},
"comment": {
"shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
},
"isOptional": true
},
{
"name": "headers",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true
},
{
"name": "url",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "GoTrueAdminApi"
}
},
"comment": {
"shortText": "Creates an admin API client that can be used to manage users and OAuth clients.",
"examples": [
{
"id": "using-supabase-js-recommended",
"name": "Using supabase-js (recommended)",
"code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-secret-key')\nconst { data, error } = await supabase.auth.admin.listUsers()\n```"
},
{
"id": "standalone-import-for-bundle-sensitive-environments",
"name": "Standalone import for bundle-sensitive environments",
"code": "```ts\nimport { GoTrueAdminApi } from '@supabase/auth-js'\n\nconst admin = new GoTrueAdminApi({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { Authorization: `Bearer ${process.env.SUPABASE_SECRET_KEY}` },\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.createUser": {
"name": "@supabase/auth-js.GoTrueAdminApi.createUser",
"params": [
{
"name": "attributes",
"type": {
"type": "object",
"name": "AdminUserAttributes",
"properties": [
{
"name": "app_metadata",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information."
}
},
{
"name": "ban_duration",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user."
}
},
{
"name": "current_password",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true."
}
},
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The user's email."
}
},
{
"name": "email_confirm",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify."
}
},
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user."
}
},
{
"name": "nonce",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first."
}
},
{
"name": "password",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The user's password."
}
},
{
"name": "password_hash",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes."
}
},
{
"name": "phone",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The user's phone."
}
},
{
"name": "phone_confirm",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify."
}
},
{
"name": "role",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges."
}
},
{
"name": "user_metadata",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "banned_until",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "confirmed_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "created_at",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "deleted_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "totp"
},
{
"type": "literal",
"value": "phone"
},
{
"type": "literal",
"value": "webauthn"
}
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "totp"
},
{
"type": "literal",
"value": "phone"
},
{
"type": "literal",
"value": "webauthn"
}
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "any"
}
},
"isOptional": true
},
{
"name": "identity_id",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "last_sign_in_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "provider",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "updated_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "user_id",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "is_anonymous",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true
},
{
"name": "is_sso_user",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "new_email",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "new_phone",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "phone",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "role",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "updated_at",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "literal",
"value": null
}
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Creates a new user.\nThis function should only be called on a server. Never expose your `service_role` key in the browser.",
"text": "- To confirm the user's email address or phone number, set `email_confirm` or `phone_confirm` to true. Both arguments default to false.\n- `createUser()` will not send a confirmation email to the user. You can use [`inviteUserByEmail()`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead.\n- If you are sure that the created user's email or phone number is legitimate and verified, you can set the `email_confirm` or `phone_confirm` param to `true`.",
"examples": [
{
"id": "with-custom-user-metadata",
"name": "With custom user metadata",
"code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: '[email protected]',\n password: 'password',\n user_metadata: { name: 'Yoda' }\n})\n```",
"response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: '[email protected]',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```"
},
{
"id": "auto-confirm-the-user-s-email",
"name": "Auto-confirm the user's email",
"code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: '[email protected]',\n email_confirm: true\n})\n```"
},
{
"id": "auto-confirm-the-user-s-phone-number",
"name": "Auto-confirm the user's phone number",
"code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n phone: '1234567890',\n phone_confirm: true\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.deleteUser": {
"name": "@supabase/auth-js.GoTrueAdminApi.deleteUser",
"params": [
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user id you want to remove."
}
},
{
"name": "shouldSoftDelete",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"comment": {
"shortText": "If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible.\nDefaults to false for backward compatibility.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Delete a user. Requires a `service_role` key.",
"text": "- The `deleteUser()` method requires the user's ID, which maps to the `auth.users.id` column.",
"examples": [
{
"id": "removes-a-user",
"name": "Removes a user",
"code": "```js\nconst { data, error } = await supabase.auth.admin.deleteUser(\n '715ed5db-f090-4b8c-a067-640ecee36aa0'\n)\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {}\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.generateLink": {
"name": "@supabase/auth-js.GoTrueAdminApi.generateLink",
"params": [
{
"name": "params",
"type": {
"type": "union",
"name": "GenerateLinkParams",
"subTypes": [
{
"name": "GenerateSignupLinkParams",
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "options",
"isOptional": true
},
{
"name": "password",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "type",
"type": {
"type": "literal",
"value": "signup"
}
}
]
},
{
"name": "GenerateInviteOrMagiclinkParams",
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's email"
}
},
{
"name": "options",
"isOptional": true
},
{
"name": "type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "invite"
},
{
"type": "literal",
"value": "magiclink"
}
]
}
}
]
},
{
"name": "GenerateRecoveryLinkParams",
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's email"
}
},
{
"name": "options",
"isOptional": true
},
{
"name": "type",
"type": {
"type": "literal",
"value": "recovery"
}
}
]
},
{
"name": "GenerateEmailChangeLinkParams",
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's email"
}
},
{
"name": "newEmail",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's new email. Only required if type is 'email_change_current' or 'email_change_new'."
}
},
{
"name": "options",
"isOptional": true
},
{
"name": "type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "email_change_current"
},
{
"type": "literal",
"value": "email_change_new"
}
]
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "GenerateLinkResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "properties",
"type": {
"name": "GenerateLinkProperties",
"type": "object",
"properties": [
{
"name": "action_link",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The email link to send to the user.\nThe action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}"
}
},
{
"name": "email_otp",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The raw email OTP.\nYou should send this in the email if you want your users to verify using an OTP instead of the action link."
}
},
{
"name": "hashed_token",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The hashed token appended to the action link."
}
},
{
"name": "redirect_to",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The URL appended to the action link."
}
},
{
"name": "verification_type",
"type": {
"type": "union",
"name": "GenerateLinkType",
"subTypes": [
{
"type": "literal",
"value": "signup"
},
{
"type": "literal",
"value": "invite"
},
{
"type": "literal",
"value": "magiclink"
},
{
"type": "literal",
"value": "recovery"
},
{
"type": "literal",
"value": "email_change_current"
},
{
"type": "literal",
"value": "email_change_new"
}
]
},
"comment": {
"shortText": "The verification type that the email link is associated to."
}
}
]
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "properties",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Generates email links and OTPs to be sent via a custom email provider.",
"text": "- The following types can be passed into `generateLink()`: `signup`, `magiclink`, `invite`, `recovery`, `email_change_current`, `email_change_new`, `phone_change`.\n- `generateLink()` only generates the email link for `email_change_email` if the **Secure email change** is enabled in your project's [email auth provider settings](/dashboard/project/_/auth/providers).\n- `generateLink()` handles the creation of the user for `signup`, `invite` and `magiclink`.",
"examples": [
{
"id": "generate-a-signup-link",
"name": "Generate a signup link",
"code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'signup',\n email: '[email protected]',\n password: 'secret'\n})\n```",
"response": "```json\n{\n \"data\": {\n \"properties\": {\n \"action_link\": \"<LINK_TO_SEND_TO_USER>\",\n \"email_otp\": \"999999\",\n \"hashed_token\": \"<HASHED_TOKEN\",\n \"redirect_to\": \"<REDIRECT_URL>\",\n \"verification_type\": \"signup\"\n },\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```"
},
{
"id": "generate-an-invite-link",
"name": "Generate an invite link",
"code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'invite',\n email: '[email protected]'\n})\n```"
},
{
"id": "generate-a-magic-link",
"name": "Generate a magic link",
"code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'magiclink',\n email: '[email protected]'\n})\n```"
},
{
"id": "generate-a-recovery-link",
"name": "Generate a recovery link",
"code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'recovery',\n email: '[email protected]'\n})\n```"
},
{
"id": "generate-links-to-change-current-email-address",
"name": "Generate links to change current email address",
"code": "```js\n// generate an email change link to be sent to the current email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_current',\n email: '[email protected]',\n newEmail: '[email protected]'\n})\n\n// generate an email change link to be sent to the new email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_new',\n email: '[email protected]',\n newEmail: '[email protected]'\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.getUserById": {
"name": "@supabase/auth-js.GoTrueAdminApi.getUserById",
"params": [
{
"name": "uid",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's unique identifier\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Get user by id.",
"text": "- Fetches the user object from the database based on the user's id.\n- The `getUserById()` method requires the user's id which maps to the `auth.users.id` column.",
"examples": [
{
"id": "fetch-the-user-object-using-the-access-token-jwt",
"name": "Fetch the user object using the access_token jwt",
"code": "```js\nconst { data, error } = await supabase.auth.admin.getUserById(1)\n```",
"response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: '[email protected]',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail": {
"name": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail",
"params": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The email address of the user."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store additional metadata about the user. This maps to the `auth.users.user_metadata` column."
}
},
{
"name": "redirectTo",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL."
}
}
]
},
"comment": {
"shortText": "Additional options to be included when inviting."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Sends an invite link to an email address.",
"text": "- Sends an invite link to the user's email address.\n- The `inviteUserByEmail()` method is typically used by administrators to invite users to join the application.\n- Note that PKCE is not supported when using `inviteUserByEmail`. This is because the browser initiating the invite is often different from the browser accepting the invite which makes it difficult to provide the security guarantees required of the PKCE flow.",
"examples": [
{
"id": "invite-a-user",
"name": "Invite a user",
"code": "```js\nconst { data, error } = await supabase.auth.admin.inviteUserByEmail('[email protected]')\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"invited_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.listUsers": {
"name": "@supabase/auth-js.GoTrueAdminApi.listUsers",
"params": [
{
"name": "params",
"type": {
"name": "PageParams",
"type": "object",
"properties": [
{
"name": "page",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true,
"comment": {
"shortText": "The page number"
}
},
{
"name": "perPage",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true,
"comment": {
"shortText": "Number of items returned per page"
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "An object which supports `page` and `perPage` as numbers, to alter the paginated results."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data"
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "users"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Get a list of users.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser.",
"text": "- Defaults to return 50 users per page.",
"examples": [
{
"id": "get-a-page-of-users",
"name": "Get a page of users",
"code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers()\n```"
},
{
"id": "paginated-list-of-users",
"name": "Paginated list of users",
"code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers({\n page: 1,\n perPage: 1000\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueAdminApi.signOut": {
"name": "@supabase/auth-js.GoTrueAdminApi.signOut",
"params": [
{
"name": "jwt",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "A valid, logged-in JWT."
}
},
{
"name": "scope",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "global"
},
{
"type": "literal",
"value": "local"
},
{
"type": "literal",
"value": "others"
}
]
},
"comment": {
"shortText": "The logout sope."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "nameOnly",
"name": "AuthError"
}
]
}
}
]
}
}
},
"comment": {
"shortText": "Removes a logged-in session."
}
},
"@supabase/auth-js.GoTrueAdminApi.updateUserById": {
"name": "@supabase/auth-js.GoTrueAdminApi.updateUserById",
"params": [
{
"name": "uid",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's unique identifier"
}
},
{
"name": "attributes",
"type": {
"type": "object",
"name": "AdminUserAttributes",
"properties": [
{
"name": "app_metadata",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information."
}
},
{
"name": "ban_duration",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user."
}
},
{
"name": "current_password",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true."
}
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The user's email."
}
},
{
"name": "email_confirm",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify."
}
},
{
"name": "id",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user."
}
},
{
"name": "nonce",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first."
}
},
{
"name": "password",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The user's password."
}
},
{
"name": "password_hash",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes."
}
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The user's phone."
}
},
{
"name": "phone_confirm",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify."
}
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges."
}
},
{
"name": "user_metadata",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data."
}
}
]
},
"comment": {
"shortText": "The data you want to update.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Updates the user data. Changes are applied directly without confirmation flows.",
"text": "**Important:** This is a server-side operation and does **not** trigger client-side\n`onAuthStateChange` listeners. The admin API has no connection to client state.\n\nTo sync changes to the client after calling this method:\n1. On the client, call `supabase.auth.refreshSession()` to fetch the updated user data\n2. This will trigger the `TOKEN_REFRESHED` event and notify all listeners",
"examples": [
{
"id": "example-1",
"name": "Example 1",
"code": "```typescript\n// Server-side (Edge Function)\nconst { data, error } = await supabase.auth.admin.updateUserById(\n userId,\n { user_metadata: { preferences: { theme: 'dark' } } }\n)\n\n// Client-side (to sync the changes)\nconst { data, error } = await supabase.auth.refreshSession()\n// onAuthStateChange listeners will now be notified with updated user\n```"
},
{
"id": "updates-a-user-s-email",
"name": "Updates a user's email",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '11111111-1111-1111-1111-111111111111',\n { email: '[email protected]' }\n)\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```"
},
{
"id": "updates-a-user-s-password",
"name": "Updates a user's password",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { password: 'new_password' }\n)\n```"
},
{
"id": "updates-a-user-s-metadata",
"name": "Updates a user's metadata",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { user_metadata: { hello: 'world' } }\n)\n```"
},
{
"id": "updates-a-user-s-app-metadata",
"name": "Updates a user's app_metadata",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { app_metadata: { plan: 'trial' } }\n)\n```"
},
{
"id": "confirms-a-user-s-email-address",
"name": "Confirms a user's email address",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { email_confirm: true }\n)\n```"
},
{
"id": "confirms-a-user-s-phone-number",
"name": "Confirms a user's phone number",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { phone_confirm: true }\n)\n```"
},
{
"id": "ban-a-user-for-100-years",
"name": "Ban a user for 100 years",
"code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { ban_duration: '876000h' }\n)\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.constructor": {
"name": "@supabase/auth-js.GoTrueClient.constructor",
"params": [
{
"name": "options",
"type": {
"name": "GoTrueClientOptions",
"type": "object",
"properties": [
{
"name": "autoRefreshToken",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true
},
{
"name": "debug",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "boolean"
},
{
"type": "function",
"params": [
{
"name": "message",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "args",
"type": {
"type": "array",
"elemType": {
"type": "intrinsic",
"name": "any"
}
}
}
],
"ret": {
"type": {
"type": "intrinsic",
"name": "void"
}
}
}
]
},
"isOptional": true
},
{
"name": "detectSessionInUrl",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "boolean"
},
{
"type": "function",
"params": [
{
"name": "url",
"type": {
"type": "nameOnly",
"name": "URL"
}
},
{
"name": "params",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
}
}
],
"ret": {
"type": {
"type": "intrinsic",
"name": "boolean"
}
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "Set to \"true\" if you want to automatically detect OAuth grants in the URL and sign in the user.\nSet to \"false\" to disable automatic detection.\nSet to a function to provide custom logic for determining if a URL contains a Supabase auth callback.\nThe function receives the current URL and parsed parameters, and should return true if the URL\nshould be processed as a Supabase auth callback, or false to ignore it.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return\naccess_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.",
"examples": [
{
"id": "example-1",
"name": "Example 1",
"code": "```ts\ndetectSessionInUrl: (url, params) => {\n // Ignore Facebook OAuth redirects\n if (url.pathname === '/facebook/redirect') return false\n // Use default detection for other URLs\n return Boolean(params.access_token || params.error_description)\n}\n```"
}
]
}
},
{
"name": "experimental",
"type": {
"name": "ExperimentalFeatureFlags",
"type": "object",
"properties": [
{
"name": "passkey",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time."
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "Opt-in flags for experimental features. These APIs may change without\nnotice and are disabled by default.",
"tags": [
{
"tag": "experimental",
"text": ""
}
]
}
},
{
"name": "fetch",
"type": {
"type": "nameOnly",
"name": "Fetch"
},
"isOptional": true
},
{
"name": "flowType",
"type": {
"type": "union",
"name": "AuthFlowType",
"subTypes": [
{
"type": "literal",
"value": "implicit"
},
{
"type": "literal",
"value": "pkce"
},
null
]
},
"isOptional": true
},
{
"name": "hasCustomAuthorizationHeader",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "Set to \"true\" if there is a custom authorization header set globally.",
"tags": [
{
"tag": "experimental",
"text": ""
}
]
}
},
{
"name": "headers",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true
},
{
"name": "lock",
"type": {
"name": "LockFunc",
"type": "function",
"params": [
{
"name": "name",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "Name of the lock to be acquired."
}
},
{
"name": "acquireTimeout",
"type": {
"type": "intrinsic",
"name": "number"
},
"comment": {
"shortText": "If negative, no timeout should occur. If positive it\n should throw an Error with an `isAcquireTimeout`\n property set to true if the operation fails to be\n acquired after this much time (ms)."
}
},
{
"name": "fn",
"type": {
"type": "function",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "nameOnly",
"name": "R"
}
}
}
},
"comment": {
"shortText": "The operation to execute when the lock is acquired."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "nameOnly",
"name": "R"
}
}
}
},
"isOptional": true,
"comment": {
"shortText": "Provide your own locking mechanism based on the environment. By default\nthe client coordinates refreshes itself (single-flight via\n`refreshingDeferred` + commit guard) and relies on the GoTrue server to\nresolve cross-tab refresh races. Passing a custom lock opts into a\nlegacy path that wraps every auth operation in your supplied lock — this\npath is preserved for backwards compatibility (typically React Native\n`processLock` or Node multi-process setups)."
}
},
{
"name": "lockAcquireTimeout",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true,
"comment": {
"shortText": "The maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via the `lock` option. Only consulted when a custom `lock` is\npassed — the default lockless path doesn't use this timeout."
}
},
{
"name": "persistSession",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true
},
{
"name": "skipAutoInitialize",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If true, skips automatic initialization in constructor. Useful for SSR\ncontexts where initialization timing must be controlled to prevent race\nconditions with HTTP response generation."
}
},
{
"name": "storage",
"type": {
"type": "nameOnly",
"name": "SupportedStorage"
},
"isOptional": true
},
{
"name": "storageKey",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "throwOnError",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If there is an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response."
}
},
{
"name": "url",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "userStorage",
"type": {
"type": "nameOnly",
"name": "SupportedStorage"
},
"isOptional": true,
"comment": {
"shortText": "Stores the user object in a separate storage location from the rest of the session data. When non-null, `storage` will only store a JSON object containing the access and refresh token and some adjacent metadata, while `userStorage` will only contain the user object under the key `storageKey + '-user'`.\n\nWhen this option is set and cookie storage is used, `getSession()` and other functions that load a session from the cookie store might not return back a user. It's very important to always use `getUser()` to fetch a user object in those scenarios.",
"tags": [
{
"tag": "experimental",
"text": ""
}
]
}
}
]
}
}
],
"ret": {
"type": {
"type": "nameOnly",
"name": "GoTrueClient"
}
},
"comment": {
"shortText": "Create a new client for use in the browser.",
"examples": [
{
"id": "using-supabase-js-recommended",
"name": "Using supabase-js (recommended)",
"code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.auth.getUser()\n```"
},
{
"id": "standalone-import-for-bundle-sensitive-environments",
"name": "Standalone import for bundle-sensitive environments",
"code": "```ts\nimport { GoTrueClient } from '@supabase/auth-js'\n\nconst auth = new GoTrueClient({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { apikey: 'your-publishable-key' },\n storageKey: 'supabase-auth',\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.dispose": {
"name": "@supabase/auth-js.GoTrueClient.dispose",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "intrinsic",
"name": "void"
}
}
},
"comment": {
"shortText": "Tears down the client's background work: stops the auto-refresh interval,\nremoves the `visibilitychange` listener, closes the cross-tab\n`BroadcastChannel`, and clears registered `onAuthStateChange` subscribers.\n\nCall this from cleanup hooks when the client is being replaced before\nits JS realm is destroyed. React Strict Mode and HMR are the common\ncases. Any in-flight `fetch` calls continue to completion and may still\nwrite to storage; dispose doesn't abort them or erase storage.\n\nLifecycle caveat: because in-flight refreshes are not aborted, a\ndisposed instance can still persist a rotated session to storage after\n`dispose()` returns. A subsequent `createClient` against the same\n`storageKey` will pick up that session on its next read. If you need\nstrict isolation between client lifecycles, await any pending auth\noperation before calling `dispose()` (or change the `storageKey` for\nthe replacement client).\n\nSafe to call repeatedly.",
"examples": [
{
"id": "cleanup-on-react-unmount",
"name": "Cleanup on React unmount",
"code": "```ts\nuseEffect(() => {\n const client = createClient(...)\n return () => { client.auth.dispose() }\n}, [])\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.exchangeCodeForSession": {
"name": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession",
"params": [
{
"name": "authCode",
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthTokenResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": {
"type": "intrinsic",
"name": "number"
},
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "intrinsic",
"name": "string"
}
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "intrinsic",
"name": "string"
}
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": {
"type": "literal",
"value": "bearer"
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Log in an existing user by exchanging an Auth Code issued during the PKCE flow.",
"text": "- Used when `flowType` is set to `pkce` in client options.",
"examples": [
{
"id": "exchange-auth-code",
"name": "Exchange Auth Code",
"code": "```js\nsupabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')\n```",
"response": "```json\n{\n \"data\": {\n session: {\n access_token: '<ACCESS_TOKEN>',\n token_type: 'bearer',\n expires_in: 3600,\n expires_at: 1700000000,\n refresh_token: '<REFRESH_TOKEN>',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: '[email protected]'\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n \"provider\": \"email\",\n \"providers\": [\n \"email\",\n \"<OTHER_PROVIDER>\"\n ]\n },\n user_metadata: {\n email: '[email protected]',\n email_verified: true,\n full_name: 'User Name',\n iss: '<ISS>',\n name: 'User Name',\n phone_verified: false,\n provider_id: '<PROVIDER_ID>',\n sub: '<SUB>'\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"<ID>\",\n \"user_id\": \"<USER_ID>\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"<ISS>\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"<PROVIDER_ID>\",\n \"sub\": \"<SUB>\"\n },\n \"provider\": \"<PROVIDER>\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n provider_token: '<PROVIDER_TOKEN>',\n provider_refresh_token: '<PROVIDER_REFRESH_TOKEN>'\n },\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: '[email protected]',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n \"<OTHER_PROVIDER>\"\n ]\n },\n user_metadata: {\n email: '[email protected]',\n email_verified: true,\n full_name: 'User Name',\n iss: '<ISS>',\n name: 'User Name',\n phone_verified: false,\n provider_id: '<PROVIDER_ID>',\n sub: '<SUB>'\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"<ID>\",\n \"user_id\": \"<USER_ID>\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"<ISS>\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"<PROVIDER_ID>\",\n \"sub\": \"<SUB>\"\n },\n \"provider\": \"<PROVIDER>\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n redirectType: null\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.getClaims": {
"name": "@supabase/auth-js.GoTrueClient.getClaims",
"params": [
{
"name": "jwt",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "An optional specific JWT you wish to verify, not the one you\n can obtain from #getSession."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "allowExpired",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If set to `true` the `exp` claim will not be validated against the current time."
}
},
{
"name": "jwks",
"type": {
"type": "object",
"properties": [
{
"name": "keys",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "JWK",
"properties": [
{
"name": "alg",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "key_ops",
"type": {
"type": "array",
"elemType": {
"type": "intrinsic",
"name": "string"
}
}
},
{
"name": "kid",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "kty",
"type": {
"type": "union",
"subTypes": [
null,
{
"type": "literal",
"value": "RSA"
},
{
"type": "literal",
"value": "EC"
},
{
"type": "literal",
"value": "oct"
}
]
}
}
]
}
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "If set, this JSON Web Key Set is going to have precedence over the cached value available on the server."
}
},
{
"name": "keys",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "JWK",
"properties": [
{
"name": "alg",
"type": "[Circular]",
"isOptional": true
},
{
"name": "key_ops",
"type": {
"type": "array",
"elemType": "[Circular]"
}
},
{
"name": "kid",
"type": "[Circular]",
"isOptional": true
},
{
"name": "kty",
"type": {
"type": "union",
"subTypes": [
null,
"[Circular]",
"[Circular]",
"[Circular]"
]
}
}
]
}
},
"isOptional": true,
"comment": {
"shortText": ""
}
}
]
},
"comment": {
"shortText": "Various additional options that allow you to customize the\n behavior of this method."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "claims",
"type": {
"type": "object",
"name": "JwtPayload",
"properties": [
{
"name": "aal",
"type": {
"type": "union",
"name": "AuthenticatorAssuranceLevels",
"subTypes": [
{
"type": "literal",
"value": "aal1"
},
{
"type": "literal",
"value": "aal2"
},
null
]
}
},
{
"name": "amr",
"type": {
"type": "union",
"subTypes": [
{
"type": "array",
"elemType": {
"type": "intrinsic",
"name": "string"
}
},
{
"type": "array",
"elemType": {
"type": "object",
"name": "AMREntry",
"properties": [
{
"name": "method",
"type": {
"type": "union",
"name": "AMRMethod",
"subTypes": [
{
"type": "nameOnly",
"name": "['number']"
},
null
]
},
"comment": {
"shortText": "Authentication method name."
}
},
{
"name": "timestamp",
"type": {
"type": "intrinsic",
"name": "number"
},
"comment": {
"shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC."
}
}
]
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "Authentication Method References.\nSupports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).\n- String format: ['password', 'otp'] - RFC-8176 compliant\n- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps"
}
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
},
"isOptional": true
},
{
"name": "aud",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "array",
"elemType": {
"type": "intrinsic",
"name": "string"
}
}
]
}
},
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "exp",
"type": {
"type": "intrinsic",
"name": "number"
}
},
{
"name": "iat",
"type": {
"type": "intrinsic",
"name": "number"
}
},
{
"name": "is_anonymous",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true
},
{
"name": "iss",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "jti",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "nbf",
"type": {
"type": "intrinsic",
"name": "number"
},
"isOptional": true
},
{
"name": "phone",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "ref",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "role",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "session_id",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "sub",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
},
"isOptional": true
}
]
}
},
{
"name": "header",
"type": {
"name": "JwtHeader",
"type": "object",
"properties": [
{
"name": "alg",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "RS256"
},
{
"type": "literal",
"value": "ES256"
},
{
"type": "literal",
"value": "HS256"
},
null
]
}
},
{
"name": "kid",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "typ",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
},
{
"name": "signature",
"type": {
"type": "nameOnly",
"name": "Uint8Array"
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Extracts the JWT claims present in the access token by first verifying the\nJWT against the server's JSON Web Key Set endpoint\n`/.well-known/jwks.json` which is often cached, resulting in significantly\nfaster responses. Prefer this method over #getUser which always\nsends a request to the Auth server for each JWT.\n\nIf the project is not using an asymmetric JWT signing key (like ECC or\nRSA) it always sends a request to the Auth server (similar to #getUser) to verify the JWT.",
"text": "- Parses the user's [access token](/docs/guides/auth/sessions#access-token-jwt-claims) as a [JSON Web Token (JWT)](/docs/guides/auth/jwts) and returns its components if valid and not expired.\n- If your project is using asymmetric JWT signing keys, then the verification is done locally usually without a network request using the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).\n- A network request is sent to your project's JWT signing key discovery endpoint `https://project-id.supabase.co/auth/v1/.well-known/jwks.json`, which is cached locally. If your environment is ephemeral, such as a Lambda function that is destroyed after every request, a network request will be sent for each new invocation. Supabase provides a network-edge cache providing fast responses for these situations.\n- If the user's access token is about to expire when calling this function, the user's session will first be refreshed before validating the JWT.\n- If your project is using a symmetric secret to sign the JWT, it always sends a request similar to `getUser()` to validate the JWT at the server before returning the decoded token. This is also used if the WebCrypto API is not available in the environment. Make sure you polyfill it in such situations.\n- The returned claims can be customized per project using the [Custom Access Token Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook).",
"examples": [
{
"id": "get-jwt-claims-header-and-signature",
"name": "Get JWT claims, header and signature",
"code": "```js\nconst { data, error } = await supabase.auth.getClaims()\n```",
"response": "```json\n{\n \"data\": {\n \"claims\": {\n \"aal\": \"aal1\",\n \"amr\": [{\n \"method\": \"email\",\n \"timestamp\": 1715766000\n }],\n \"app_metadata\": {},\n \"aud\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"exp\": 1715769600,\n \"iat\": 1715766000,\n \"is_anonymous\": false,\n \"iss\": \"https://project-id.supabase.co/auth/v1\",\n \"phone\": \"+13334445555\",\n \"role\": \"authenticated\",\n \"session_id\": \"11111111-1111-1111-1111-111111111111\",\n \"sub\": \"11111111-1111-1111-1111-111111111111\",\n \"user_metadata\": {}\n },\n \"header\": {\n \"alg\": \"RS256\",\n \"typ\": \"JWT\",\n \"kid\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"signature\": [/** Uint8Array */],\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.getSession": {
"name": "@supabase/auth-js.GoTrueClient.getSession",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "literal",
"value": null
}
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "literal",
"value": null
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Returns the session, refreshing it if necessary.\n\nThe session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.\n\n**IMPORTANT:** This method loads values directly from the storage attached\nto the client. If that storage is based on request cookies for example,\nthe values in it may not be authentic and therefore it's strongly advised\nagainst using this method and its results in such circumstances. A warning\nwill be emitted if this is detected. Use #getUser() instead.",
"text": "- Since the introduction of [asymmetric JWT signing keys](/docs/guides/auth/signing-keys), this method is considered low-level and we encourage you to use `getClaims()` or `getUser()` instead.\n- Retrieves the current [user session](/docs/guides/auth/sessions) from the storage medium (local storage, cookies).\n- The session contains an access token (signed JWT), a refresh token and the user object.\n- If the session's access token is expired or is about to expire, this method will use the refresh token to refresh the session.\n- When using in a browser, or you've called `startAutoRefresh()` in your environment (React Native, etc.) this function always returns a valid access token without refreshing the session itself, as this is done in the background. This function returns very fast.\n- **IMPORTANT SECURITY NOTICE:** If using an insecure storage medium, such as cookies or request headers, the user object returned by this function **must not be trusted**. Always verify the JWT using `getClaims()` or your own JWT verification library to securely establish the user's identity and access. You can also use `getUser()` to fetch the user object directly from the Auth server for this purpose.\n- Cross-tab refresh races are handled by the GoTrue server (the rotated token from the first tab is returned to subsequent tabs via the parent-of-active mechanism), so no client-side serialization is needed.",
"examples": [
{
"id": "get-the-session-data",
"name": "Get the session data",
"code": "```js\nconst { data, error } = await supabase.auth.getSession()\n```",
"response": "```json\n{\n \"data\": {\n \"session\": {\n \"access_token\": \"<ACCESS_TOKEN>\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"<REFRESH_TOKEN>\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.getUser": {
"name": "@supabase/auth-js.GoTrueClient.getUser",
"params": [
{
"name": "jwt",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "UserResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Gets the current user details if there is an existing session. This method\nperforms a network request to the Supabase Auth server, so the returned\nvalue is authentic and can be used to base authorization rules on.",
"text": "- This method fetches the user object from the database instead of local session.\n- This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server.\n- Should always be used when checking for user authorization on the server. On the client, you can instead use `getSession().session.user` for faster results. `getSession` is insecure on the server.",
"examples": [
{
"id": "get-the-logged-in-user-with-the-current-existing-session",
"name": "Get the logged in user with the current existing session",
"code": "```js\nconst { data: { user } } = await supabase.auth.getUser()\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```"
},
{
"id": "get-the-logged-in-user-with-a-custom-access-token-jwt",
"name": "Get the logged in user with a custom access token jwt",
"code": "```js\nconst { data: { user } } = await supabase.auth.getUser(jwt)\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.getUserIdentities": {
"name": "@supabase/auth-js.GoTrueClient.getUserIdentities",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Gets all the identities linked to a user.",
"text": "- The user needs to be signed in to call `getUserIdentities()`.",
"examples": [
{
"id": "returns-a-list-of-identities-linked-to-the-user",
"name": "Returns a list of identities linked to the user",
"code": "```js\nconst { data, error } = await supabase.auth.getUserIdentities()\n```",
"response": "```json\n{\n \"data\": {\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"2024-01-01T00:00:00Z\",\n \"user_id\": \"2024-01-01T00:00:00Z\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ]\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.initialize": {
"name": "@supabase/auth-js.GoTrueClient.initialize",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"name": "InitializeResult",
"type": "object",
"properties": [
{
"name": "error",
"type": {
"type": "union",
"subTypes": [
{
"type": "nameOnly",
"name": "AuthError"
},
{
"type": "literal",
"value": null
}
]
}
}
]
}
}
},
"comment": {
"shortText": "Initialize the auth client by loading the session from storage or\ndetecting it from the URL after an OAuth, magic-link, or password-recovery\nredirect.\n\n**Most callers do not need to invoke this directly.** The client calls it\nautomatically during construction, and to react to sign-in events (including\npost-redirect events) you should subscribe to `onAuthStateChange` rather\nthan awaiting `initialize()`.\n\nYou only need to call it manually when you have opted out of the automatic\ncall by passing `skipAutoInitialize: true` — for example, in an SSR context\nwhere you need to control initialization timing. In that case, awaiting\n`initialize()` returns the resolved session result (or any error encountered\nwhile detecting it from the URL)."
}
},
"@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled": {
"name": "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled",
"params": [],
"ret": {
"type": {
"type": "intrinsic",
"name": "boolean"
}
},
"comment": {
"shortText": "Returns whether error throwing mode is enabled for this client."
}
},
"@supabase/auth-js.GoTrueClient.linkIdentity": {
"name": "@supabase/auth-js.GoTrueClient.linkIdentity",
"params": [
{
"name": "credentials",
"type": {
"name": "SignInWithOAuthCredentials",
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "queryParams",
"type": {
"type": "index signature",
"keyType": {
"type": "intrinsic",
"name": "string"
},
"valueType": {
"type": "intrinsic",
"name": "string"
}
},
"isOptional": true,
"comment": {
"shortText": "An object of query params"
}
},
{
"name": "redirectTo",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "A URL to send the user to after they are confirmed."
}
},
{
"name": "scopes",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "A space-separated list of scopes granted to the OAuth application."
}
},
{
"name": "skipBrowserRedirect",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider."
}
}
]
},
"isOptional": true
},
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
{
"type": "literal",
"value": "apple"
},
{
"type": "literal",
"value": "azure"
},
{
"type": "literal",
"value": "bitbucket"
},
{
"type": "literal",
"value": "discord"
},
{
"type": "literal",
"value": "facebook"
},
{
"type": "literal",
"value": "figma"
},
{
"type": "literal",
"value": "github"
},
{
"type": "literal",
"value": "gitlab"
},
{
"type": "literal",
"value": "google"
},
{
"type": "literal",
"value": "kakao"
},
{
"type": "literal",
"value": "keycloak"
},
{
"type": "literal",
"value": "linkedin"
},
{
"type": "literal",
"value": "linkedin_oidc"
},
{
"type": "literal",
"value": "notion"
},
{
"type": "literal",
"value": "slack"
},
{
"type": "literal",
"value": "slack_oidc"
},
{
"type": "literal",
"value": "spotify"
},
{
"type": "literal",
"value": "twitch"
},
{
"type": "literal",
"value": "twitter"
},
{
"type": "literal",
"value": "x"
},
{
"type": "literal",
"value": "workos"
},
{
"type": "literal",
"value": "zoom"
},
{
"type": "literal",
"value": "fly"
},
null
]
},
"comment": {
"shortText": "One of the providers supported by GoTrue."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "OAuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null
]
}
},
{
"name": "url",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null
]
}
},
{
"name": "url",
"type": {
"type": "literal",
"value": null
}
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Links an oauth identity to an existing user.\nThis method supports the PKCE flow.",
"text": "- The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n- The user needs to be signed in to call `linkIdentity()`.\n- If the candidate identity is already linked to the existing user or another user, `linkIdentity()` will fail.\n- If `linkIdentity` is run in the browser, the user is automatically redirected to the returned URL. On the server, you should handle the redirect.",
"examples": [
{
"id": "link-an-identity-to-a-user",
"name": "Link an identity to a user",
"code": "```js\nconst { data, error } = await supabase.auth.linkIdentity({\n provider: 'github'\n})\n```",
"response": "```json\n{\n data: {\n provider: 'github',\n url: <PROVIDER_URL_TO_REDIRECT_TO>\n },\n error: null\n}\n```"
}
]
},
"altSignatures": [
{
"params": [
{
"name": "credentials",
"type": {
"name": "SignInWithIdTokenCredentials",
"type": "object",
"properties": [
{
"name": "access_token",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token."
}
},
{
"name": "nonce",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
}
]
},
"isOptional": true
},
{
"name": "provider",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "google"
},
{
"type": "literal",
"value": "apple"
},
{
"type": "literal",
"value": "azure"
},
{
"type": "literal",
"value": "facebook"
},
{
"type": "literal",
"value": "kakao"
},
null,
null
]
},
"comment": {
"shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)."
}
},
{
"name": "token",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthTokenResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
}
}
]
},
"@supabase/auth-js.GoTrueClient.onAuthStateChange": {
"name": "@supabase/auth-js.GoTrueClient.onAuthStateChange",
"params": [
{
"name": "callback",
"type": {
"type": "function",
"params": [
{
"name": "event",
"type": {
"type": "union",
"name": "AuthChangeEvent",
"subTypes": [
{
"type": "literal",
"value": "INITIAL_SESSION"
},
{
"type": "literal",
"value": "PASSWORD_RECOVERY"
},
{
"type": "literal",
"value": "SIGNED_IN"
},
{
"type": "literal",
"value": "SIGNED_OUT"
},
{
"type": "literal",
"value": "TOKEN_REFRESHED"
},
{
"type": "literal",
"value": "USER_UPDATED"
},
{
"type": "literal",
"value": "MFA_CHALLENGE_VERIFIED",
"name": "AuthChangeEventMFA"
}
]
}
},
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "intrinsic",
"name": "void"
}
}
},
"comment": {
"shortText": "A callback function to be invoked when an auth event happens."
}
}
],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "subscription",
"type": {
"type": "object",
"name": "Subscription",
"properties": [
{
"name": "callback",
"type": {
"type": "function",
"params": [
{
"name": "event",
"type": {
"type": "union",
"name": "AuthChangeEvent",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
}
},
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "intrinsic",
"name": "void"
}
}
},
"comment": {
"shortText": "The function to call every time there is an event. eg: (eventName) => {}"
}
},
{
"name": "id",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "symbol"
}
]
},
"comment": {
"shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners."
}
},
{
"name": "unsubscribe",
"type": {
"type": "function",
"params": [],
"ret": {
"type": {
"type": "intrinsic",
"name": "void"
}
}
},
"comment": {
"shortText": "Call this to remove the listener."
}
}
]
}
}
]
}
}
]
}
},
"comment": {
"shortText": "Receive a notification every time an auth event happens.\nSafe to use without an async function as callback.",
"text": "- Subscribes to important events occurring on the user's session.\n- Use on the frontend/client. It is less useful on the server.\n- Events are emitted across tabs to keep your application's UI up-to-date. Some events can fire very frequently, based on the number of tabs open. Use a quick and efficient callback function, and defer or debounce as many operations as you can to be performed outside of the callback.\n- Callbacks can be `async` and can safely call other Supabase auth methods (`getUser`, `setSession`, etc.) from inside the callback.\n- Keep callbacks quick. Events are awaited in order, so a slow callback delays subsequent events to subscribers in this tab.\n- Emitted events:\n - `INITIAL_SESSION`\n - Emitted right after the Supabase client is constructed and the initial session from storage is loaded.\n - `SIGNED_IN`\n - Emitted each time a user session is confirmed or re-established, including on user sign in and when refocusing a tab.\n - Avoid making assumptions as to when this event is fired, this may occur even when the user is already signed in. Instead, check the user object attached to the event to see if a new user has signed in and update your application's UI.\n - This event can fire very frequently depending on the number of tabs open in your application.\n - `SIGNED_OUT`\n - Emitted when the user signs out. This can be after:\n - A call to `supabase.auth.signOut()`.\n - After the user's session has expired for any reason:\n - User has signed out on another device.\n - The session has reached its timebox limit or inactivity timeout.\n - User has signed in on another device with single session per user enabled.\n - Check the [User Sessions](/docs/guides/auth/sessions) docs for more information.\n - Use this to clean up any local storage your application has associated with the user.\n - `TOKEN_REFRESHED`\n - Emitted each time a new access and refresh token are fetched for the signed in user.\n - It's best practice and highly recommended to extract the access token (JWT) and store it in memory for further use in your application.\n - Avoid frequent calls to `supabase.auth.getSession()` for the same purpose.\n - There is a background process that keeps track of when the session should be refreshed so you will always receive valid tokens by listening to this event.\n - The frequency of this event is related to the JWT expiry limit configured on your project.\n - `USER_UPDATED`\n - Emitted each time the `supabase.auth.updateUser()` method finishes successfully. Listen to it to update your application's UI based on new profile information.\n - `PASSWORD_RECOVERY`\n - Emitted instead of the `SIGNED_IN` event when the user lands on a page that includes a password recovery link in the URL.\n - Use it to show a UI to the user where they can [reset their password](/docs/guides/auth/passwords#resetting-a-users-password-forgot-password).",
"examples": [
{
"id": "listen-to-auth-changes",
"name": "Listen to auth changes",
"code": "```js\nconst { data } = supabase.auth.onAuthStateChange((event, session) => {\n console.log(event, session)\n\n if (event === 'INITIAL_SESSION') {\n // handle initial session\n } else if (event === 'SIGNED_IN') {\n // handle sign in event\n } else if (event === 'SIGNED_OUT') {\n // handle sign out event\n } else if (event === 'PASSWORD_RECOVERY') {\n // handle password recovery event\n } else if (event === 'TOKEN_REFRESHED') {\n // handle token refreshed event\n } else if (event === 'USER_UPDATED') {\n // handle user updated event\n }\n})\n\n// call unsubscribe to remove the callback\ndata.subscription.unsubscribe()\n```"
},
{
"id": "listen-to-sign-out",
"name": "Listen to sign out",
"code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'SIGNED_OUT') {\n console.log('SIGNED_OUT', session)\n\n // clear local and session storage\n [\n window.localStorage,\n window.sessionStorage,\n ].forEach((storage) => {\n Object.entries(storage)\n .forEach(([key]) => {\n storage.removeItem(key)\n })\n })\n }\n})\n```",
"description": "Make sure you clear out any local data, such as local and session storage, after the client library has detected the user's sign out."
},
{
"id": "store-oauth-provider-tokens-on-sign-in",
"name": "Store OAuth provider tokens on sign in",
"code": "```js\n// Register this immediately after calling createClient!\n// Because signInWithOAuth causes a redirect, you need to fetch the\n// provider tokens from the callback.\nsupabase.auth.onAuthStateChange((event, session) => {\n if (session && session.provider_token) {\n window.localStorage.setItem('oauth_provider_token', session.provider_token)\n }\n\n if (session && session.provider_refresh_token) {\n window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n }\n\n if (event === 'SIGNED_OUT') {\n window.localStorage.removeItem('oauth_provider_token')\n window.localStorage.removeItem('oauth_provider_refresh_token')\n }\n})\n```",
"description": "When using [OAuth (Social Login)](/docs/guides/auth/social-login) you sometimes wish to get access to the provider's access token and refresh token, in order to call provider APIs in the name of the user.\n\nFor example, if you are using [Sign in with Google](/docs/guides/auth/social-login/auth-google) you may want to use the provider token to call Google APIs on behalf of the user. Supabase Auth does not keep track of the provider access and refresh token, but does return them for you once, immediately after sign in. You can use the `onAuthStateChange` method to listen for the presence of the provider tokens and store them in local storage. You can further send them to your server's APIs for use on the backend.\n\nFinally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend."
},
{
"id": "use-react-context-for-the-user-s-session",
"name": "Use React Context for the User's session",
"code": "```js\nconst SessionContext = React.createContext(null)\n\nfunction main() {\n const [session, setSession] = React.useState(null)\n\n React.useEffect(() => {\n const {data: { subscription }} = supabase.auth.onAuthStateChange(\n (event, session) => {\n if (event === 'SIGNED_OUT') {\n setSession(null)\n } else if (session) {\n setSession(session)\n }\n })\n\n return () => {\n subscription.unsubscribe()\n }\n }, [])\n\n return (\n <SessionContext.Provider value={session}>\n <App />\n </SessionContext.Provider>\n )\n}\n```",
"description": "Instead of relying on `supabase.auth.getSession()` within your React components, you can use a [React Context](https://react.dev/reference/react/createContext) to store the latest session information from the `onAuthStateChange` callback and access it that way."
},
{
"id": "listen-to-password-recovery-events",
"name": "Listen to password recovery events",
"code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'PASSWORD_RECOVERY') {\n console.log('PASSWORD_RECOVERY', session)\n // show screen to update user's password\n showPasswordResetScreen(true)\n }\n})\n```"
},
{
"id": "listen-to-sign-in",
"name": "Listen to sign in",
"code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'SIGNED_IN') console.log('SIGNED_IN', session)\n})\n```"
},
{
"id": "listen-to-token-refresh",
"name": "Listen to token refresh",
"code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'TOKEN_REFRESHED') console.log('TOKEN_REFRESHED', session)\n})\n```"
},
{
"id": "listen-to-user-updates",
"name": "Listen to user updates",
"code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'USER_UPDATED') console.log('USER_UPDATED', session)\n})\n```"
}
]
},
"altSignatures": [
{
"params": [
{
"name": "callback",
"type": {
"type": "function",
"params": [
{
"name": "event",
"type": {
"type": "union",
"name": "AuthChangeEvent",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
}
},
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": null
},
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "intrinsic",
"name": "void"
}
}
}
},
"comment": {
"shortText": "A callback function to be invoked when an auth event happens."
}
}
],
"ret": {
"type": {
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "subscription",
"type": {
"type": "object",
"name": "Subscription",
"properties": [
{
"name": "callback",
"type": {
"type": "function",
"params": [
{
"name": "event",
"type": {
"type": "union",
"name": "AuthChangeEvent",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]"
]
}
},
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
]
}
}
],
"ret": {
"type": "[Circular]"
}
},
"comment": {
"shortText": "The function to call every time there is an event. eg: (eventName) => {}"
}
},
{
"name": "id",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners."
}
},
{
"name": "unsubscribe",
"type": {
"type": "function",
"params": [],
"ret": {
"type": "[Circular]"
}
},
"comment": {
"shortText": "Call this to remove the listener."
}
}
]
}
}
]
}
}
]
}
}
}
]
},
"@supabase/auth-js.GoTrueClient.reauthenticate": {
"name": "@supabase/auth-js.GoTrueClient.reauthenticate",
"params": [],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
},
{
"type": "literal",
"value": null
}
]
}
},
{
"name": "user",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
{
"type": "literal",
"value": null
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Sends a reauthentication OTP to the user's email or phone number.\nRequires the user to be signed-in.",
"text": "- This method is used together with `updateUser()` when a user's password needs to be updated.\n- If you require your user to reauthenticate before updating their password, you need to enable the **Secure password change** option in your [project's email provider settings](/dashboard/project/_/auth/providers).\n- A user is only require to reauthenticate before updating their password if **Secure password change** is enabled and the user **hasn't recently signed in**. A user is deemed recently signed in if the session was created in the last 24 hours.\n- This method will send a nonce to the user's email. If the user doesn't have a confirmed email address, the method will send the nonce to the user's confirmed phone number instead.\n- After receiving the OTP, include it as the `nonce` in your `updateUser()` call to finalize the password change.",
"examples": [
{
"id": "send-reauthentication-nonce",
"name": "Send reauthentication nonce",
"code": "```js\nconst { error } = await supabase.auth.reauthenticate()\n```",
"description": "Sends a reauthentication nonce to the user's email or phone number."
}
]
}
},
"@supabase/auth-js.GoTrueClient.refreshSession": {
"name": "@supabase/auth-js.GoTrueClient.refreshSession",
"params": [
{
"name": "currentSession",
"type": {
"type": "object",
"properties": [
{
"name": "refresh_token",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
},
"isOptional": true,
"comment": {
"shortText": "The current session. If passed in, it must contain a refresh token."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
},
"[Circular]"
]
}
},
{
"name": "user",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"[Circular]"
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Returns a new session, regardless of expiry status.\nTakes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession().\nIf the current session's refresh token is invalid, an error will be thrown.",
"text": "- This method will refresh and return a new session whether the current one is expired or not.",
"examples": [
{
"id": "refresh-session-using-the-current-session",
"name": "Refresh session using the current session",
"code": "```js\nconst { data, error } = await supabase.auth.refreshSession()\nconst { session, user } = data\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"<ACCESS_TOKEN>\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"<REFRESH_TOKEN>\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```"
},
{
"id": "refresh-session-using-a-refresh-token",
"name": "Refresh session using a refresh token",
"code": "```js\nconst { data, error } = await supabase.auth.refreshSession({ refresh_token })\nconst { session, user } = data\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.registerPasskey": {
"name": "@supabase/auth-js.GoTrueClient.registerPasskey",
"params": [
{
"name": "credentials",
"type": {
"name": "RegisterPasskeyCredentials",
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "signal",
"type": {
"type": "nameOnly",
"name": "AbortSignal"
},
"isOptional": true
}
]
},
"isOptional": true
}
]
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthPasskeyRegistrationVerifyResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"name": "PasskeyMetadata",
"type": "object",
"properties": [
{
"name": "created_at",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "friendly_name",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "id",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error"
}
]
}
]
}
}
},
"comment": {
"shortText": "Register a passkey for the current authenticated user. Handles the full WebAuthn ceremony:\n1. Fetches registration challenge from server\n2. Prompts user via navigator.credentials.create()\n3. Verifies credential with server\n\nRequires an active session. Requires `auth.experimental.passkey: true`."
}
},
"@supabase/auth-js.GoTrueClient.resend": {
"name": "@supabase/auth-js.GoTrueClient.resend",
"params": [
{
"name": "credentials",
"type": {
"type": "union",
"name": "ResendParams",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
},
{
"name": "emailRedirectTo",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "A URL to send the user to after they have signed-in."
}
}
]
},
"isOptional": true
},
{
"name": "type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "signup"
},
{
"type": "literal",
"value": "email_change"
}
]
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
}
]
},
"isOptional": true
},
{
"name": "phone",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "type",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "sms"
},
{
"type": "literal",
"value": "phone_change"
}
]
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthOtpResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "messageId",
"type": {
"type": "union",
"subTypes": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "literal",
"value": null
}
]
},
"isOptional": true
},
{
"name": "session",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "user",
"type": {
"type": "literal",
"value": null
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "messageId",
"type": "[Circular]"
},
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Resends an existing signup confirmation email, email change email, SMS OTP or phone change OTP.",
"text": "- Resends a signup confirmation, email change or phone change email to the user.\n- Passwordless sign-ins can be resent by calling the `signInWithOtp()` method again.\n- Password recovery emails can be resent by calling the `resetPasswordForEmail()` method again.\n- This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made(note: For existing users signing in with OTP, you should use `signInWithOtp()` again to resend the OTP).\n- You can specify a redirect url when you resend an email link using the `emailRedirectTo` option.",
"examples": [
{
"id": "resend-an-email-signup-confirmation",
"name": "Resend an email signup confirmation",
"code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'signup',\n email: '[email protected]',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```",
"description": "Resends the email signup confirmation to the user"
},
{
"id": "resend-a-phone-signup-confirmation",
"name": "Resend a phone signup confirmation",
"code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'sms',\n phone: '1234567890'\n})\n```",
"description": "Resends the phone signup confirmation email to the user"
},
{
"id": "resend-email-change-email",
"name": "Resend email change email",
"code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'email_change',\n email: '[email protected]'\n})\n```",
"description": "Resends the email change email to the user"
},
{
"id": "resend-phone-change-otp",
"name": "Resend phone change OTP",
"code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'phone_change',\n phone: '1234567890'\n})\n```",
"description": "Resends the phone change OTP to the user"
}
]
}
},
"@supabase/auth-js.GoTrueClient.resetPasswordForEmail": {
"name": "@supabase/auth-js.GoTrueClient.resetPasswordForEmail",
"params": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The email address of the user."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
},
{
"name": "redirectTo",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The URL to send the user to after they click the password reset link."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data"
},
{
"name": "error",
"type": {
"type": "literal",
"value": null
}
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "literal",
"value": null
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Sends a password reset request to an email address. This method supports the PKCE flow.",
"text": "- The password reset flow consist of 2 broad steps: (i) Allow the user to login via the password reset link; (ii) Update the user's password.\n- The `resetPasswordForEmail()` only sends a password reset link to the user's email.\nTo update the user's password, see [`updateUser()`](/docs/reference/javascript/auth-updateuser).\n- A `PASSWORD_RECOVERY` event will be emitted when the password recovery link is clicked.\nYou can use [`onAuthStateChange()`](/docs/reference/javascript/auth-onauthstatechange) to listen and invoke a callback function on these events.\n- When the user clicks the reset link in the email they are redirected back to your application.\nYou can configure the URL that the user is redirected to with the `redirectTo` parameter.\nSee [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- After the user has been redirected successfully, prompt them for a new password and call `updateUser()`:\n```js\nconst { data, error } = await supabase.auth.updateUser({\n password: new_password\n})\n```",
"examples": [
{
"id": "reset-password",
"name": "Reset password",
"code": "```js\nconst { data, error } = await supabase.auth.resetPasswordForEmail(email, {\n redirectTo: 'https://example.com/update-password',\n})\n```",
"response": "```json\n{\n data: {}\n error: null\n}\n```"
},
{
"id": "reset-password-react",
"name": "Reset password (React)",
"code": "```js\n/**\n * Step 1: Send the user an email to get a password reset token.\n * This email contains a link which sends the user back to your application.\n */\nconst { data, error } = await supabase.auth\n .resetPasswordForEmail('[email protected]')\n\n/**\n * Step 2: Once the user is redirected back to your application,\n * ask the user to reset their password.\n */\n useEffect(() => {\n supabase.auth.onAuthStateChange(async (event, session) => {\n if (event == \"PASSWORD_RECOVERY\") {\n const newPassword = prompt(\"What would you like your new password to be?\");\n const { data, error } = await supabase.auth\n .updateUser({ password: newPassword })\n\n if (data) alert(\"Password updated successfully!\")\n if (error) alert(\"There was an error updating your password.\")\n }\n })\n }, [])\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.setSession": {
"name": "@supabase/auth-js.GoTrueClient.setSession",
"params": [
{
"name": "currentSession",
"type": {
"type": "object",
"properties": [
{
"name": "access_token",
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"name": "refresh_token",
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
},
"comment": {
"shortText": "The current session that minimally contains an access token and refresh token."
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
},
"[Circular]"
]
}
},
{
"name": "user",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"[Circular]"
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.\nIf the refresh token or access token in the current session is invalid, an error will be thrown.",
"text": "- This method sets the session using an `access_token` and `refresh_token`.\n- If successful, a `SIGNED_IN` event is emitted.",
"examples": [
{
"id": "set-the-session",
"name": "Set the session",
"code": "```js\n const { data, error } = await supabase.auth.setSession({\n access_token,\n refresh_token\n })\n```",
"description": "Sets the session data from an access_token and refresh_token, then returns an auth response or error.",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"<ACCESS_TOKEN>\",\n \"refresh_token\": \"<REFRESH_TOKEN>\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"[email protected]\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"11111111-1111-1111-1111-111111111111\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"2024-01-01T00:00:00Z\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"[email protected]\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"[email protected]\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"token_type\": \"bearer\",\n \"expires_in\": 3500,\n \"expires_at\": 1700000000\n }\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.signInAnonymously": {
"name": "@supabase/auth-js.GoTrueClient.signInAnonymously",
"params": [
{
"name": "credentials",
"type": {
"name": "SignInAnonymouslyCredentials",
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
},
{
"name": "data",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name."
}
}
]
},
"isOptional": true
}
]
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
},
"[Circular]"
]
}
},
{
"name": "user",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"[Circular]"
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Creates a new anonymous user.",
"text": "- Returns an anonymous user\n- It is recommended to set up captcha for anonymous sign-ins to prevent abuse. You can pass in the captcha token in the `options` param.",
"examples": [
{
"id": "create-an-anonymous-user",
"name": "Create an anonymous user",
"code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n captchaToken\n }\n});\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n },\n \"session\": {\n \"access_token\": \"<ACCESS_TOKEN>\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"<REFRESH_TOKEN>\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n }\n }\n },\n \"error\": null\n}\n```"
},
{
"id": "create-an-anonymous-user-with-custom-user-metadata",
"name": "Create an anonymous user with custom user metadata",
"code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n data\n }\n})\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.signInWithIdToken": {
"name": "@supabase/auth-js.GoTrueClient.signInWithIdToken",
"params": [
{
"name": "credentials",
"type": {
"name": "SignInWithIdTokenCredentials",
"type": "object",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token."
}
},
{
"name": "nonce",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
}
]
},
"isOptional": true
},
{
"name": "provider",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null,
null
]
},
"comment": {
"shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)."
}
},
{
"name": "token",
"type": "[Circular]",
"comment": {
"shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthTokenResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Allows signing in with an OIDC ID token. The authentication provider used\nshould be enabled and configured.",
"text": "- Use an ID token to sign in.\n- Especially useful when implementing sign in using native platform dialogs in mobile or desktop apps using Sign in with Apple or Sign in with Google on iOS and Android.\n- You can also use Google's [One Tap](https://developers.google.com/identity/gsi/web/guides/display-google-one-tap) and [Automatic sign-in](https://developers.google.com/identity/gsi/web/guides/automatic-sign-in-sign-out) via this API.",
"examples": [
{
"id": "sign-in-using-id-token",
"name": "Sign In using ID Token",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithIdToken({\n provider: 'google',\n token: 'your-id-token'\n})\n```",
"response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n },\n \"session\": {\n \"access_token\": \"<ACCESS_TOKEN>\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"<REFRESH_TOKEN>\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n }\n }\n },\n \"error\": null\n}\n```"
}
]
}
},
"@supabase/auth-js.GoTrueClient.signInWithOAuth": {
"name": "@supabase/auth-js.GoTrueClient.signInWithOAuth",
"params": [
{
"name": "credentials",
"type": {
"name": "SignInWithOAuthCredentials",
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "queryParams",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "An object of query params"
}
},
{
"name": "redirectTo",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A URL to send the user to after they are confirmed."
}
},
{
"name": "scopes",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A space-separated list of scopes granted to the OAuth application."
}
},
{
"name": "skipBrowserRedirect",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider."
}
}
]
},
"isOptional": true
},
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null
]
},
"comment": {
"shortText": "One of the providers supported by GoTrue."
}
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "OAuthResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null
]
}
},
{
"name": "url",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "provider",
"type": {
"type": "union",
"name": "Provider",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
"[Circular]",
null
]
}
},
{
"name": "url",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Log in an existing user via a third-party provider.\nThis method supports the PKCE flow.",
"text": "- This method is used for signing in using [Social Login (OAuth) providers](/docs/guides/auth#configure-third-party-providers).\n- It works by redirecting your application to the provider's authorization screen, before bringing back the user to your app.",
"examples": [
{
"id": "sign-in-using-a-third-party-provider",
"name": "Sign in using a third-party provider",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github'\n})\n```",
"response": "```json\n{\n data: {\n provider: 'github',\n url: <PROVIDER_URL_TO_REDIRECT_TO>\n },\n error: null\n}\n```"
},
{
"id": "sign-in-using-a-third-party-provider-with-redirect",
"name": "Sign in using a third-party provider with redirect",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n redirectTo: 'https://example.com/welcome'\n }\n})\n```",
"description": "- When the OAuth provider successfully authenticates the user, they are redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls). It does not redirect the user immediately after invoking this method.\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project."
},
{
"id": "sign-in-with-scopes-and-access-provider-tokens",
"name": "Sign in with scopes and access provider tokens",
"code": "```js\n// Register this immediately after calling createClient!\n// Because signInWithOAuth causes a redirect, you need to fetch the\n// provider tokens from the callback.\nsupabase.auth.onAuthStateChange((event, session) => {\n if (session && session.provider_token) {\n window.localStorage.setItem('oauth_provider_token', session.provider_token)\n }\n\n if (session && session.provider_refresh_token) {\n window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n }\n\n if (event === 'SIGNED_OUT') {\n window.localStorage.removeItem('oauth_provider_token')\n window.localStorage.removeItem('oauth_provider_refresh_token')\n }\n})\n\n// Call this on your Sign in with GitHub button to initiate OAuth\n// with GitHub with the requested elevated scopes.\nawait supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n scopes: 'repo gist notifications'\n }\n})\n```",
"description": "If you need additional access from an OAuth provider, in order to access provider specific APIs in the name of the user, you can do this by passing in the scopes the user should authorize for your application. Note that the `scopes` option takes in **a space-separated list** of scopes.\n\nBecause OAuth sign-in often includes redirects, you should register an `onAuthStateChange` callback immediately after you create the Supabase client. This callback will listen for the presence of `provider_token` and `provider_refresh_token` properties on the `session` object and store them in local storage. The client library will emit these values **only once** immediately after the user signs in. You can then access them by looking them up in local storage, or send them to your backend servers for further processing.\n\nFinally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend."
}
]
}
},
"@supabase/auth-js.GoTrueClient.signInWithOtp": {
"name": "@supabase/auth-js.GoTrueClient.signInWithOtp",
"params": [
{
"name": "credentials",
"type": {
"type": "union",
"name": "SignInWithPasswordlessCredentials",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "email",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's email address."
}
},
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
},
{
"name": "data",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name."
}
},
{
"name": "emailRedirectTo",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "The redirect url embedded in the email link"
}
},
{
"name": "shouldCreateUser",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If set to false, this method will not create a new user. Defaults to true."
}
}
]
},
"isOptional": true
}
]
},
{
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true,
"comment": {
"shortText": "Verification token received when the user completes the captcha on the site."
}
},
{
"name": "channel",
"type": {
"type": "union",
"subTypes": [
{
"type": "literal",
"value": "sms"
},
{
"type": "literal",
"value": "whatsapp"
}
]
},
"isOptional": true,
"comment": {
"shortText": "Messaging channel to use (e.g. whatsapp or sms)"
}
},
{
"name": "data",
"type": {
"type": "intrinsic",
"name": "object"
},
"isOptional": true,
"comment": {
"shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name."
}
},
{
"name": "shouldCreateUser",
"type": {
"type": "intrinsic",
"name": "boolean"
},
"isOptional": true,
"comment": {
"shortText": "If set to false, this method will not create a new user. Defaults to true."
}
}
]
},
"isOptional": true
},
{
"name": "phone",
"type": {
"type": "intrinsic",
"name": "string"
},
"comment": {
"shortText": "The user's phone number."
}
}
]
}
]
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthOtpResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "messageId",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true
},
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "messageId",
"type": "[Circular]"
},
{
"name": "session",
"type": "[Circular]"
},
{
"name": "user",
"type": "[Circular]"
}
]
}
},
{
"name": "error",
"type": {
"type": "nameOnly",
"name": "AuthError"
}
}
]
}
]
}
}
},
"comment": {
"shortText": "Log in a user using magiclink or a one-time password (OTP).\n\nIf the `{{ .ConfirmationURL }}` variable is specified in the email template, a magiclink will be sent.\nIf the `{{ .Token }}` variable is specified in the email template, an OTP will be sent.\nIf you're using phone sign-ins, only an OTP will be sent. You won't be able to send a magiclink for phone sign-ins.\n\nBe aware that you may get back an error message that will not distinguish\nbetween the cases where the account does not exist or, that the account\ncan only be accessed via social login.\n\nDo note that you will need to configure a Whatsapp sender on Twilio\nif you are using phone sign in with the 'whatsapp' channel. The whatsapp\nchannel is not supported on other providers\nat this time.\nThis method supports PKCE when an email is passed.",
"text": "- Requires either an email or phone number.\n- This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number.\n- If the user doesn't exist, `signInWithOtp()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` in `SignInWithPasswordlessCredentials.options` to `false`.\n- If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP.\n- If you're using phone, you can configure whether you want the user to receive a OTP.\n- The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls).\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`.\n- See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login?showSMSProvider=Twilio) for details about configuring WhatsApp sign in.",
"examples": [
{
"id": "sign-in-with-email",
"name": "Sign in with email",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n email: '[email protected]',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```",
"description": "The user will be sent an email which contains either a magiclink or a OTP or both. By default, a given user can only request a OTP once every 60 seconds.",
"response": "```json\n{\n \"data\": {\n \"user\": null,\n \"session\": null\n },\n \"error\": null\n}\n```"
},
{
"id": "sign-in-with-sms-otp",
"name": "Sign in with SMS OTP",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n})\n```",
"description": "The user will be sent a SMS which contains a OTP. By default, a given user can only request a OTP once every 60 seconds."
},
{
"id": "sign-in-with-whatsapp-otp",
"name": "Sign in with WhatsApp OTP",
"code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n options: {\n channel:'whatsapp',\n }\n})\n```",
"description": "The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature."
}
]
}
},
"@supabase/auth-js.GoTrueClient.signInWithPasskey": {
"name": "@supabase/auth-js.GoTrueClient.signInWithPasskey",
"params": [
{
"name": "credentials",
"type": {
"name": "SignInWithPasskeyCredentials",
"type": "object",
"properties": [
{
"name": "options",
"type": {
"type": "object",
"properties": [
{
"name": "captchaToken",
"type": {
"type": "intrinsic",
"name": "string"
},
"isOptional": true
},
{
"name": "signal",
"type": {
"type": "nameOnly",
"name": "AbortSignal"
},
"isOptional": true
}
]
},
"isOptional": true
}
]
},
"isOptional": true
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthPasskeyAuthenticationVerifyResponse",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
},
{
"type": "literal",
"value": null
}
]
}
},
{
"name": "user",
"type": {
"type": "union",
"subTypes": [
{
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
{
"type": "literal",
"value": null
}
]
}
}
]
}
},
{
"name": "error",
"type": "[Circular]"
}
]
},
{
"type": "object",
"properties": [
{
"name": "data",
"type": "[Circular]"
},
{
"name": "error"
}
]
}
]
}
}
},
"comment": {
"shortText": "Sign in with a passkey. Handles the full WebAuthn ceremony:\n1. Fetches authentication challenge from server\n2. Prompts user via navigator.credentials.get()\n3. Verifies credential with server and creates session\n\nRequires `auth.experimental.passkey: true`."
}
},
"@supabase/auth-js.GoTrueClient.signInWithPassword": {
"name": "@supabase/auth-js.GoTrueClient.signInWithPassword",
"params": [
{
"name": "credentials",
"type": {
"type": "nameOnly",
"name": "SignInWithPasswordCredentials"
}
}
],
"ret": {
"type": {
"type": "promise",
"name": "Promise",
"awaited": {
"type": "union",
"name": "AuthTokenResponsePassword",
"subTypes": [
{
"type": "object",
"properties": [
{
"name": "data",
"type": {
"type": "object",
"properties": [
{
"name": "session",
"type": {
"type": "object",
"name": "Session",
"properties": [
{
"name": "access_token",
"type": "[Circular]",
"comment": {
"shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value."
}
},
{
"name": "expires_at",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "A timestamp of when the token will expire. Returned when a login is confirmed."
}
},
{
"name": "expires_in",
"type": "[Circular]",
"comment": {
"shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed."
}
},
{
"name": "provider_refresh_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token."
}
},
{
"name": "provider_token",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]"
]
},
"isOptional": true,
"comment": {
"shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used."
}
},
{
"name": "refresh_token",
"type": "[Circular]",
"comment": {
"shortText": "A one-time used refresh token that never expires."
}
},
{
"name": "token_type",
"type": "[Circular]"
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
},
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
},
{
"name": "last_challenged_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "status",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`"
}
},
{
"name": "updated_at",
"type": "[Circular]"
}
]
}
]
}
},
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identities",
"type": {
"type": "array",
"elemType": {
"type": "object",
"name": "UserIdentity",
"properties": [
{
"name": "created_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "id",
"type": "[Circular]"
},
{
"name": "identity_data",
"type": {
"type": "index signature",
"keyType": "[Circular]",
"valueType": "[Circular]"
},
"isOptional": true
},
{
"name": "identity_id",
"type": "[Circular]"
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "provider",
"type": "[Circular]"
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_id",
"type": "[Circular]"
}
]
}
},
"isOptional": true
},
{
"name": "invited_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_anonymous",
"type": "[Circular]",
"isOptional": true
},
{
"name": "is_sso_user",
"type": "[Circular]",
"isOptional": true
},
{
"name": "last_sign_in_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "new_phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone",
"type": "[Circular]",
"isOptional": true
},
{
"name": "phone_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "recovery_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "role",
"type": "[Circular]",
"isOptional": true
},
{
"name": "updated_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "user_metadata",
"type": {
"type": "object",
"name": "UserMetadata",
"properties": []
}
}
]
},
"comment": {
"shortText": "When using a separate user storage, accessing properties of this object will throw an error."
}
}
]
}
},
{
"name": "user",
"type": {
"type": "object",
"name": "User",
"properties": [
{
"name": "action_link",
"type": "[Circular]",
"isOptional": true
},
{
"name": "app_metadata",
"type": {
"type": "object",
"name": "UserAppMetadata",
"properties": [
{
"name": "provider",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "The first provider that the user used to sign up with."
}
},
{
"name": "providers",
"type": {
"type": "array",
"elemType": "[Circular]"
},
"isOptional": true,
"comment": {
"shortText": "A list of all providers that the user has linked to their account."
}
}
]
}
},
{
"name": "aud",
"type": "[Circular]"
},
{
"name": "banned_until",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmation_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "deleted_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_change_sent_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "email_confirmed_at",
"type": "[Circular]",
"isOptional": true
},
{
"name": "factors",
"type": {
"type": "array",
"elemType": {
"type": "union",
"subTypes": [
{
"name": "Factor",
"type": "object",
"properties": [
{
"name": "created_at",
"type": "[Circular]"
},
{
"name": "factor_type",
"type": {
"type": "union",
"subTypes": [
"[Circular]",
"[Circular]",
"[Circular]"
]
},
"comment": {
"shortText": "Type of factor. `totp` and `phone` supported with this version"
}
},
{
"name": "friendly_name",
"type": "[Circular]",
"isOptional": true,
"comment": {
"shortText": "Friendly name of the factor, useful to disambiguate between multiple factors."
}
},
{
"name": "id",
"type": "[Circular]",
"comment": {
"shortText": "ID of the factor."
}
File truncated at 1 MB.