{ "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-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]" ], "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]" ] }, { "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/platform/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-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: 'user@email.com',\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: 'example@email.com',\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\": \"example@email.com\",\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@example.com\"\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: 'user@email.com',\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@example.com',\n password: 'secret'\n})\n```", "response": "```json\n{\n \"data\": {\n \"properties\": {\n \"action_link\": \"\",\n \"email_otp\": \"999999\",\n \"hashed_token\": \"\",\n \"verification_type\": \"signup\"\n },\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"email@example.com\",\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@example.com\",\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@example.com\"\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@example.com'\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@example.com'\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@example.com'\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: 'current.email@example.com',\n newEmail: 'new.email@example.com'\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: 'current.email@example.com',\n newEmail: 'new.email@example.com'\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: 'example@email.com',\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\": \"example@email.com\",\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@example.com\"\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@example.com')\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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: 'new@email.com' }\n)\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"new@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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: '',\n token_type: 'bearer',\n expires_in: 3600,\n expires_at: 1700000000,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com'\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 \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n 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\": \"example@email.com\",\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@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"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\": \"example@email.com\"\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: '',\n provider_refresh_token: ''\n },\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n 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\": \"example@email.com\",\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@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"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\": \"example@email.com\"\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\": \"example@email.com\",\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"example@email.com\",\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\": \"example@email.com\"\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: \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 \n \n \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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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@example.com',\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@example.com'\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('user@email.com')\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"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: \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: 'example@email.com',\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." } }, { "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": "weakPassword", "type": { "name": "WeakPassword", "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "reasons", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "WeakPasswordReasons" } } } ] }, "isOptional": true } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "session", "type": "[Circular]" }, { "name": "user", "type": "[Circular]" }, { "name": "weakPassword", "type": "[Circular]" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Log in an existing user with an email and password or phone and password.\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\nemail/phone and password combination is wrong or that the account can only\nbe accessed via social login.", "text": "- Requires either an email and password or a phone number and password.", "examples": [ { "id": "sign-in-with-email-and-password", "name": "Sign in with email and password", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\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```" }, { "id": "sign-in-with-phone-and-password", "name": "Sign in with phone and password", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n phone: '+13334445555',\n password: 'some-password',\n})\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\nif (error) {\n console.error(error)\n return\n}\n```", "description": "Log the full `error` object so fields like `code`, `status`, and `name` aren't hidden. The `error.code` (e.g. `'invalid_credentials'`, `'email_not_confirmed'`) is often more useful for branching than `error.message`, and the full object surfaces both." } ] } }, "@supabase/auth-js.GoTrueClient.signInWithSSO": { "name": "@supabase/auth-js.GoTrueClient.signInWithSSO", "params": [ { "name": "params", "type": { "type": "union", "name": "SignInWithSSO", "subTypes": [ { "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they have signed-in." } }, { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." } } ] }, "isOptional": true }, { "name": "providerId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the SSO provider to invoke single-sign on to." } } ] }, { "type": "object", "properties": [ { "name": "domain", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Domain name of the organization for which to invoke single-sign on." } }, { "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": "A URL to send the user to after they have signed-in." } }, { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." } } ] }, "isOptional": true } ] } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "SSOResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL to open in a browser which will complete the sign-in flow by\ntaking the user to the identity provider's authentication flow.\n\nOn browsers you can set the URL to `window.location.href` to take\nthe user to the authentication flow." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Attempts a single-sign on using an enterprise Identity Provider. A\nsuccessful SSO attempt will redirect the current page to the identity\nprovider authorization page. The redirect URL is implementation and SSO\nprotocol specific.\n\nYou can use it by providing a SSO domain. Typically you can extract this\ndomain by asking users for their email address. If this domain is\nregistered on the Auth instance the redirect will use that organization's\ncurrently active SSO Identity Provider for the login.\n\nIf you have built an organization-specific login page, you can use the\norganization's SSO Identity Provider UUID directly instead.", "text": "- Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this.\n- If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow.\n- In case you need to use a different way to start the authentication flow with an identity provider, you can use the `providerId` property. For example:\n - Mapping specific user email addresses with an identity provider.\n - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information.", "examples": [ { "id": "sign-in-with-email-domain", "name": "Sign in with email domain", "code": "```js\n // You can extract the user's email domain and use it to trigger the\n // authentication flow with the correct identity provider.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n domain: 'company.com'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" }, { "id": "sign-in-with-provider-uuid", "name": "Sign in with provider UUID", "code": "```js\n // Useful when you need to map a user's sign in request according\n // to different rules that can't use email domains.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n providerId: '21648a9d-8d5a-4555-a9d1-d6375dc14e92'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" } ] } }, "@supabase/auth-js.GoTrueClient.signInWithWeb3": { "name": "@supabase/auth-js.GoTrueClient.signInWithWeb3", "params": [ { "name": "credentials", "type": { "type": "union", "name": "Web3Credentials", "subTypes": [ { "type": "union", "name": "SolanaWeb3Credentials", "subTypes": [ { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "solana" } }, { "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": "signInWithSolana", "type": { "type": "nameOnly", "name": "Partial" }, "isOptional": true }, { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." } } ] }, "isOptional": true }, { "name": "statement", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" } }, { "name": "wallet", "type": { "name": "SolanaWallet", "type": "object", "properties": [ { "name": "publicKey", "type": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "toBase58", "type": { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "string" } } } } ] }, { "type": "literal", "value": null } ] }, "isOptional": true }, { "name": "signIn", "type": { "type": "function", "params": [ { "name": "inputs", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "SolanaSignInInput" } } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "SolanaSignInOutput" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "SolanaSignInOutput" } } ] } } } }, "isOptional": true }, { "name": "signMessage", "type": { "type": "function", "params": [ { "name": "message", "type": { "type": "nameOnly", "name": "Uint8Array" } }, { "name": "encoding", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "utf8" }, { "type": "intrinsic", "name": "string" } ] }, "isOptional": true } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "Uint8Array" } }, { "type": "intrinsic", "name": "undefined" } ] } } }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Wallet interface to use. If not specified will default to `window.solana`." } } ] }, { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "solana" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`." } }, { "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": "signature", "type": { "type": "nameOnly", "name": "Uint8Array" }, "comment": { "shortText": "Ed25519 signature of the message." } } ] } ] }, { "type": "union", "name": "EthereumWeb3Credentials", "subTypes": [ { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "ethereum" } }, { "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": "signInWithEthereum", "type": { "type": "nameOnly", "name": "Partial" }, "isOptional": true }, { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." } } ] }, "isOptional": true }, { "name": "statement", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" } }, { "name": "wallet", "type": { "type": "nameOnly", "name": "EthereumWallet" }, "isOptional": true, "comment": { "shortText": "Wallet interface to use. If not specified will default to `window.ethereum`." } } ] }, { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "ethereum" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`." } }, { "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": "signature", "type": { "type": "nameOnly", "name": "Hex" }, "comment": { "shortText": "Ethereum curve (secp256k1) signature of the message." } } ] } ] } ] } } ], "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": "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": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "session", "type": { "type": "literal", "value": null } }, { "name": "user", "type": { "type": "literal", "value": null } } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Signs in a user by verifying a message signed by the user's private key.\nSupports Ethereum (via Sign-In-With-Ethereum) & Solana (Sign-In-With-Solana) standards,\nboth of which derive from the EIP-4361 standard\nWith slight variation on Solana's side.", "text": "- Uses a Web3 (Ethereum, Solana) wallet to sign a user in.\n- Read up on the [potential for abuse](/docs/guides/auth/auth-web3#potential-for-abuse) before using it.", "examples": [ { "id": "sign-in-with-solana-or-ethereum-window-api", "name": "Sign in with Solana or Ethereum (Window API)", "code": "```js\n // uses window.ethereum for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n\n // uses window.solana for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n```" }, { "id": "sign-in-with-ethereum-message-and-signature", "name": "Sign in with Ethereum (Message and Signature)", "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n message: '',\n signature: '',\n })\n```" }, { "id": "sign-in-with-solana-brave", "name": "Sign in with Solana (Brave)", "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet: window.braveSolana\n })\n```" }, { "id": "sign-in-with-solana-wallet-adapter", "name": "Sign in with Solana (Wallet Adapter)", "code": "```jsx\n function SignInButton() {\n const wallet = useWallet()\n\n return (\n <>\n {wallet.connected ? (\n {\n supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet,\n })\n }}\n >\n Sign in with Solana\n \n ) : (\n \n )}\n \n )\n}\n\nfunction App() {\n const endpoint = clusterApiUrl('devnet')\n const wallets = useMemo(() => [], [])\n\n return (\n \n \n \n \n \n \n \n )\n}\n```" } ] } }, "@supabase/auth-js.GoTrueClient.signOut": { "name": "@supabase/auth-js.GoTrueClient.signOut", "params": [ { "name": "options", "type": { "name": "SignOut", "type": "object", "properties": [ { "name": "scope", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "global" }, { "type": "literal", "value": "local" }, { "type": "literal", "value": "others" } ] }, "isOptional": true, "comment": { "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "object", "properties": [ { "name": "error", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "nameOnly", "name": "AuthError" } ] } } ] } } }, "comment": { "shortText": "Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `\"SIGNED_OUT\"` event.\n\nFor server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.\nThere is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.\n\nIf using `others` scope, no `SIGNED_OUT` event is fired!\n\n**Warning:** the default `scope` is `'global'`. This signs the user out of\n**every device they are currently signed in on**, not just the current\ntab/session. If you only want to sign the user out of the current session\n(the behavior most other auth libraries default to), pass\n`{ scope: 'local' }` explicitly.", "text": "- In order to use the `signOut()` method, the user needs to be signed in first.\n- By default, `signOut()` uses the **global** scope, which signs out the user\n on every device they are signed in on (not just the current one). Pass\n `{ scope: 'local' }` to only sign out the current session. This is\n usually what apps want on a \"Sign out\" button, especially when users\n sign in from multiple devices and do not expect signing out of one to\n terminate the others.\n- Since Supabase Auth uses JWTs for authentication, the access token JWT will be valid until it's expired. When the user signs out, Supabase revokes the refresh token and deletes the JWT from the client-side. This does not revoke the JWT and it will still be valid until it expires.", "examples": [ { "id": "sign-out-of-every-device-global-default", "name": "Sign out of every device (global – default)", "code": "```js\nconst { error } = await supabase.auth.signOut()\n```" }, { "id": "sign-out-only-the-current-session-recommended-for-most-apps", "name": "Sign out only the current session (recommended for most apps)", "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'local' })\n```" }, { "id": "sign-out-of-all-other-sessions-keep-the-current-one", "name": "Sign out of all other sessions, keep the current one", "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'others' })\n```" } ] } }, "@supabase/auth-js.GoTrueClient.signUp": { "name": "@supabase/auth-js.GoTrueClient.signUp", "params": [ { "name": "credentials", "type": { "type": "nameOnly", "name": "SignUpWithPasswordCredentials" } } ], "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 user.\n\nBe aware that if a user account exists in the system you may get back an\nerror message that attempts to hide this information from the user.\nThis method has support for PKCE via email signups. The PKCE flow cannot be used when autoconfirm is enabled.", "text": "- By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](/dashboard/project/_/auth/providers).\n- **Confirm email** determines if users need to confirm their email address after signing up.\n - If **Confirm email** is enabled, a `user` is returned but `session` is null.\n - If **Confirm email** is disabled, both a `user` and a `session` are returned.\n- When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration).\n- If signUp() is called for an existing confirmed user:\n - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned.\n - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned.\n- To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).", "examples": [ { "id": "sign-up-with-an-email-and-password", "name": "Sign up with an email and password", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", "response": "```json\n// Some fields may be null if \"confirm email\" is enabled.\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\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```" }, { "id": "sign-up-with-a-phone-number-and-password-sms", "name": "Sign up with a phone number and password (SMS)", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'sms'\n }\n})\n```" }, { "id": "sign-up-with-a-phone-number-and-password-whatsapp", "name": "Sign up with a phone number and password (whatsapp)", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\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." }, { "id": "sign-up-with-additional-user-metadata", "name": "Sign up with additional user metadata", "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n data: {\n first_name: 'John',\n age: 27,\n }\n }\n }\n)\n```" }, { "id": "sign-up-with-a-redirect-url", "name": "Sign up with a redirect URL", "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n }\n)\n```", "description": "- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." } ] } }, "@supabase/auth-js.GoTrueClient.startAutoRefresh": { "name": "@supabase/auth-js.GoTrueClient.startAutoRefresh", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Starts an auto-refresh process in the background. The session is checked\nevery few seconds. Close to the time of expiration a process is started to\nrefresh the session. If refreshing fails it will be retried for as long as\nnecessary.\n\nIf you set the GoTrueClientOptions#autoRefreshToken you don't need\nto call this function, it will be called for you.\n\nOn browsers the refresh process works only when the tab/window is in the\nforeground to conserve resources as well as prevent race conditions and\nflooding auth with requests. If you call this method any managed\nvisibility change callback will be removed and you must manage visibility\nchanges on your own.\n\nOn non-browser platforms the refresh process works *continuously* in the\nbackground, which may not be desirable. You should hook into your\nplatform's foreground indication mechanism and call these methods\nappropriately to conserve resources.\n\n#stopAutoRefresh", "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- To give this hint to the application, you should be calling this method when the app is in focus and calling `supabase.auth.stopAutoRefresh()` when it's out of focus.", "examples": [ { "id": "start-and-stop-auto-refresh-in-react-native", "name": "Start and stop auto refresh in React Native", "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" } ] } }, "@supabase/auth-js.GoTrueClient.stopAutoRefresh": { "name": "@supabase/auth-js.GoTrueClient.stopAutoRefresh", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Stops an active auto refresh process running in the background (if any).\n\nIf you call this method any managed visibility change callback will be\nremoved and you must manage visibility changes on your own.\n\nSee #startAutoRefresh for more details.", "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- When your application goes in the background or out of focus, call this method to stop the proactive refreshing of the session.", "examples": [ { "id": "start-and-stop-auto-refresh-in-react-native", "name": "Start and stop auto refresh in React Native", "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" } ] } }, "@supabase/auth-js.GoTrueClient.unlinkIdentity": { "name": "@supabase/auth-js.GoTrueClient.unlinkIdentity", "params": [ { "name": "identity", "type": { "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]" } ] } } ], "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": "Unlinks an identity from a user by deleting it. The user will no longer be able to sign in with that identity once it's unlinked.", "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 `unlinkIdentity()`.\n- The user must have at least 2 identities in order to unlink an identity.\n- The identity to be unlinked must belong to the user.", "examples": [ { "id": "unlink-an-identity", "name": "Unlink an identity", "code": "```js\n// retrieve all identities linked to a user\nconst identities = await supabase.auth.getUserIdentities()\n\n// find the google identity\nconst googleIdentity = identities.find(\n identity => identity.provider === 'google'\n)\n\n// unlink the google identity\nconst { error } = await supabase.auth.unlinkIdentity(googleIdentity)\n```" } ] } }, "@supabase/auth-js.GoTrueClient.updateUser": { "name": "@supabase/auth-js.GoTrueClient.updateUser", "params": [ { "name": "attributes", "type": { "type": "object", "name": "UserAttributes", "properties": [ { "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": "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": "email", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The user's email." } }, { "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": "phone", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The user's phone." } } ] } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "emailRedirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] } } ], "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 user data for a logged in user.", "text": "- In order to use the `updateUser()` method, the user needs to be signed in first.\n- By default, email updates sends a confirmation link to both the user's current and new email.\nTo only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](/dashboard/project/_/auth/providers).", "examples": [ { "id": "update-the-email-for-an-authenticated-user", "name": "Update the email for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n email: 'new@email.com'\n})\n```", "description": "Sends a \"Confirm Email Change\" email to the new address. If **Secure Email Change** is enabled (default), confirmation is also required from the **old email** before the change is applied. To skip dual confirmation and apply the change after only the new email is verified, disable **Secure Email Change** in the [Email Auth Provider settings](/dashboard/project/_/auth/providers?provider=Email).", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"new_email\": \"new@email.com\",\n \"email_change_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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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": "update-the-phone-number-for-an-authenticated-user", "name": "Update the phone number for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n phone: '123456789'\n})\n```", "description": "Sends a one-time password (OTP) to the new phone number." }, { "id": "update-the-password-for-an-authenticated-user", "name": "Update the password for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password'\n})\n```" }, { "id": "update-the-user-s-metadata", "name": "Update the user's metadata", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n data: { hello: 'world' }\n})\n```", "description": "Updates the user's custom metadata.\n\n**Note**: The `data` field maps to the `auth.users.raw_user_meta_data` column in your Supabase database. When calling `getUser()`, the data will be available as `user.user_metadata`." }, { "id": "update-the-user-s-password-with-a-nonce", "name": "Update the user's password with a nonce", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password',\n nonce: '123456'\n})\n```", "description": "If **Secure password change** is enabled in your [project's email provider settings](/dashboard/project/_/auth/providers), updating the user's password would require a nonce if the user **hasn't recently signed in**. The nonce is sent to the user's email or phone number. A user is deemed recently signed in if the session was created in the last 24 hours." } ] } }, "@supabase/auth-js.GoTrueClient.verifyOtp": { "name": "@supabase/auth-js.GoTrueClient.verifyOtp", "params": [ { "name": "params", "type": { "type": "union", "name": "VerifyOtpParams", "subTypes": [ { "type": "object", "name": "VerifyMobileOtpParams", "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they are confirmed." } } ] }, "isOptional": true }, { "name": "phone", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The user's phone number." } }, { "name": "token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The otp sent to the user's phone number." } }, { "name": "type", "type": { "type": "union", "name": "MobileOtpType", "subTypes": [ { "type": "literal", "value": "sms" }, { "type": "literal", "value": "phone_change" }, null ] }, "comment": { "shortText": "The user's verification type." } } ] }, { "type": "object", "name": "VerifyEmailOtpParams", "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they are confirmed." } } ] }, "isOptional": true }, { "name": "token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The otp sent to the user's email address." } }, { "name": "type", "type": { "type": "union", "name": "EmailOtpType", "subTypes": [ { "type": "literal", "value": "signup" }, { "type": "literal", "value": "invite" }, { "type": "literal", "value": "magiclink" }, { "type": "literal", "value": "recovery" }, { "type": "literal", "value": "email_change" }, { "type": "literal", "value": "email" }, null ] }, "comment": { "shortText": "The user's verification type." } } ] }, { "type": "object", "name": "VerifyTokenHashParams", "properties": [ { "name": "token_hash", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The token hash used in an email link" } }, { "name": "type", "type": { "type": "union", "name": "EmailOtpType", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", null ] }, "comment": { "shortText": "The user's verification type." } } ] } ] } } ], "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": "Log in a user given a User supplied OTP or TokenHash received through mobile or email.", "text": "- The `verifyOtp` method takes in different verification types.\n- If a phone number is used, the type can either be:\n 1. `sms` – Used when verifying a one-time password (OTP) sent via SMS during sign-up or sign-in.\n 2. `phone_change` – Used when verifying an OTP sent to a new phone number during a phone number update process.\n- If an email address is used, the type can be one of the following (note: `signup` and `magiclink` types are deprecated):\n 1. `email` – Used when verifying an OTP sent to the user's email during sign-up or sign-in.\n 2. `recovery` – Used when verifying an OTP sent for account recovery, typically after a password reset request.\n 3. `invite` – Used when verifying an OTP sent as part of an invitation to join a project or organization.\n 4. `email_change` – Used when verifying an OTP sent to a new email address during an email update process.\n- The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.\n- The `TokenHash` is contained in the [email templates](/docs/guides/auth/auth-email-templates) and can be used to sign in. You may wish to use the hash for the PKCE flow for Server Side Auth. Read [the Password-based Auth guide](/docs/guides/auth/passwords) for more details.", "examples": [ { "id": "verify-signup-one-time-password-otp", "name": "Verify Signup One-Time Password (OTP)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'email'})\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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": "verify-sms-one-time-password-otp", "name": "Verify SMS One-Time Password (OTP)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})\n```" }, { "id": "verify-email-auth-token-hash", "name": "Verify Email Auth (Token Hash)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ token_hash: tokenHash, type: 'email'})\n```" } ] } }, "@supabase/auth-js.NavigatorLockAcquireTimeoutError.constructor": { "name": "@supabase/auth-js.NavigatorLockAcquireTimeoutError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "NavigatorLockAcquireTimeoutError" } } }, "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization": { "name": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID to approve" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." } } ] }, "isOptional": true, "comment": { "shortText": "Optional parameters" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthConsentResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Approves an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter approval, the user's consent is stored and an authorization code is generated.\nThe response contains a complete redirect URL with the authorization code and state." } }, "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization": { "name": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID to deny" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." } } ] }, "isOptional": true, "comment": { "shortText": "Optional parameters" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthConsentResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": "[Circular]", "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Denies an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter denial, the response contains a redirect URL with an OAuth error\n(access_denied) to inform the OAuth client that the user rejected the request." } }, "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails": { "name": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID from the authorization request" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthAuthorizationDetailsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "union", "subTypes": [ { "name": "OAuthAuthorizationDetails", "type": "object", "properties": [ { "name": "authorization_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID used to approve or deny the request" } }, { "name": "client", "type": { "name": "OAuthAuthorizationClient", "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the OAuth client (UUID)" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URI of the OAuth client's website" } } ] }, "comment": { "shortText": "OAuth client requesting authorization" } }, { "name": "redirect_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The OAuth client's registered redirect URI (base URI without query parameters)" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Space-separated list of requested scopes (e.g., \"openid profile email\")" } }, { "name": "user", "type": { "type": "object", "properties": [ { "name": "email", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "User email" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "User ID (UUID)" } } ] }, "comment": { "shortText": "User object associated with the authorization" } } ] }, { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": "[Circular]", "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Retrieves details about an OAuth authorization request.\nUsed to display consent information to the user.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis method returns one of two response types:\n- `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info\n- `OAuthRedirect`: User already consented - redirect immediately to the OAuth client\n\nUse type narrowing to distinguish between the responses:\n```typescript\nif ('authorization_id' in data) {\n // Show consent page\n} else {\n // Redirect to data.redirect_url\n}\n```" } }, "@supabase/auth-js.AuthOAuthServerApi.listGrants": { "name": "@supabase/auth-js.AuthOAuthServerApi.listGrants", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthGrantsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "OAuthGrant", "type": "object", "properties": [ { "name": "client", "type": { "name": "OAuthAuthorizationClient", "type": "object", "properties": [ { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client (UUID)" } }, { "name": "logo_uri", "type": "[Circular]", "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "uri", "type": "[Circular]", "comment": { "shortText": "URI of the OAuth client's website" } } ] }, "comment": { "shortText": "OAuth client information" } }, { "name": "granted_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the grant was created (ISO 8601 date-time)" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of scopes granted to this client" } } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all OAuth grants that the authenticated user has authorized.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth." } }, "@supabase/auth-js.AuthOAuthServerApi.revokeGrant": { "name": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The OAuth client identifier (UUID) to revoke access for" } } ] }, "comment": { "shortText": "Revocation options" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthRevokeGrantResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Revokes a user's OAuth grant for a specific client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nRevocation marks consent as revoked, deletes active sessions for that OAuth client,\nand invalidates associated refresh tokens." } }, "@supabase/auth-js.AuthPasskeyApi.delete": { "name": "@supabase/auth-js.AuthPasskeyApi.delete", "params": [ { "name": "params", "type": { "name": "PasskeyDeleteParams", "type": "object", "properties": [ { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the passkey to delete" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyDeleteResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a passkey for the currently signed-in user." } }, "@supabase/auth-js.AuthPasskeyApi.list": { "name": "@supabase/auth-js.AuthPasskeyApi.list", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "PasskeyListItem", "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": "last_used_at", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all passkeys registered for the currently signed-in user." } }, "@supabase/auth-js.AuthPasskeyApi.startAuthentication": { "name": "@supabase/auth-js.AuthPasskeyApi.startAuthentication", "params": [ { "name": "params", "type": { "name": "StartPasskeyAuthenticationParams", "type": "object", "properties": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "captchaToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyAuthenticationOptionsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyAuthenticationOptionsResponse", "type": "object", "properties": [ { "name": "challenge_id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "expires_at", "type": { "type": "intrinsic", "name": "number" } }, { "name": "options", "type": { "type": "nameOnly", "name": "ServerCredentialRequestOptions" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the passkey authentication ceremony. Fetches an authentication\nchallenge and credential request options from the server. Used as the\nfirst step of a two-step sign-in flow when the caller wants to handle\n`navigator.credentials.get()` themselves." } }, "@supabase/auth-js.AuthPasskeyApi.startRegistration": { "name": "@supabase/auth-js.AuthPasskeyApi.startRegistration", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyRegistrationOptionsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyRegistrationOptionsResponse", "type": "object", "properties": [ { "name": "challenge_id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "expires_at", "type": { "type": "intrinsic", "name": "number" } }, { "name": "options", "type": { "type": "nameOnly", "name": "ServerCredentialCreationOptions" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the passkey registration ceremony. Fetches a registration challenge\nand credential creation options from the server. Used as the first step of\na two-step registration flow when the caller wants to handle\n`navigator.credentials.create()` themselves." } }, "@supabase/auth-js.AuthPasskeyApi.update": { "name": "@supabase/auth-js.AuthPasskeyApi.update", "params": [ { "name": "params", "type": { "name": "PasskeyUpdateParams", "type": "object", "properties": [ { "name": "friendlyName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "New friendly name (max 120 chars)" } }, { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the passkey to update" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyUpdateResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyListItem", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "last_used_at", "type": "[Circular]", "isOptional": true } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates a passkey's friendly name." } }, "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication": { "name": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication", "params": [ { "name": "params", "type": { "name": "VerifyPasskeyAuthenticationParams", "type": "object", "properties": [ { "name": "challengeId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Challenge ID from startAuthentication" } }, { "name": "credential", "type": { "type": "nameOnly", "name": "ServerCredentialResponse" }, "comment": { "shortText": "Serialized credential from navigator.credentials.get()" } } ] } } ], "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." } } ] }, "[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": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a passkey authentication credential against a previously issued\nchallenge. Used as the second step of a two-step sign-in flow." } }, "@supabase/auth-js.AuthPasskeyApi.verifyRegistration": { "name": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration", "params": [ { "name": "params", "type": { "name": "VerifyPasskeyRegistrationParams", "type": "object", "properties": [ { "name": "challengeId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Challenge ID from startRegistration" } }, { "name": "credential", "type": { "type": "nameOnly", "name": "ServerCredentialResponse" }, "comment": { "shortText": "Serialized credential from navigator.credentials.create()" } } ] } } ], "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": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a passkey registration credential against a previously issued\nchallenge. Used as the second step of a two-step registration flow." } }, "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider": { "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider", "params": [ { "name": "params", "type": { "name": "CreateCustomProviderParams", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client ID" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client secret (write-only, not returned in responses)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "identifier", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ { "type": "literal", "value": "oauth2" }, { "type": "literal", "value": "oidc" } ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, { "type": "literal", "value": null } ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Creates a new custom OIDC/OAuth provider.\n\nFor OIDC providers, the server fetches and validates the OpenID Connect discovery document\nfrom the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.\nThis may return a validation error (`error_code: \"validation_failed\"`) if the discovery\ndocument is unreachable, not valid JSON, missing required fields, or if the issuer\nin the document does not match the expected issuer.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider": { "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } } ], "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": "Deletes a custom provider.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider": { "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Gets details of a specific custom provider by identifier.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders": { "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders", "params": [ { "name": "params", "type": { "name": "ListCustomProvidersParams", "type": "object", "properties": [ { "name": "type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Filter by provider type" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "providers", "type": { "type": "array", "elemType": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "providers" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Lists all custom providers with optional type filter.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider": { "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "UpdateCustomProviderParams", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth client ID" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth client secret (write-only, not returned in responses)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates an existing custom provider.\n\nWhen `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and\nvalidates the discovery document before persisting. This may return a validation error\n(`error_code: \"validation_failed\"`) if the discovery document is unreachable, invalid, or\nthe issuer does not match.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor": { "name": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor", "params": [ { "name": "params", "type": { "name": "AuthMFAAdminDeleteFactorParams", "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the MFA factor to delete." } }, { "name": "userId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the user whose factor is being deleted." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAAdminDeleteFactorResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor that was successfully deleted." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a factor on a user. This will log the user out of all active\nsessions if the deleted factor was verified.", "examples": [ { "id": "delete-a-factor-for-a-user", "name": "Delete a factor for a user", "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.deleteFactor({\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',\n})\n```", "response": "```json\n{\n data: {\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n },\n error: null\n}\n```" } ] } }, "@supabase/auth-js.GoTrueAdminMFAApi.listFactors": { "name": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors", "params": [ { "name": "params", "type": { "name": "AuthMFAAdminListFactorsParams", "type": "object", "properties": [ { "name": "userId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the user." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAAdminListFactorsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "factors", "type": { "type": "array", "elemType": { "name": "Factor", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "factor_type", "type": { "type": "nameOnly", "name": "Type" }, "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": "nameOnly", "name": "Status" }, "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]" } ] } }, "comment": { "shortText": "All factors attached to the user." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all factors associated to a user.", "examples": [ { "id": "list-all-factors-for-a-user", "name": "List all factors for a user", "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.listFactors()\n```", "response": "```json\n{\n data: {\n factors: Factor[\n {\n id: '',\n friendly_name: 'Auth App Factor',\n factor_type: 'totp',\n status: 'verified',\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.GoTrueAdminOAuthApi.createClient": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient", "params": [ { "name": "params", "type": { "name": "CreateOAuthClientParams", "type": "object", "properties": [ { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ { "type": "literal", "value": "authorization_code" }, { "type": "literal", "value": "refresh_token" }, null ] } }, "isOptional": true, "comment": { "shortText": "Array of allowed grant types (optional, defaults to authorization_code and refresh_token)" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "response_types", "type": { "type": "array", "elemType": { "type": "literal", "value": "code", "name": "OAuthClientResponseType" } }, "isOptional": true, "comment": { "shortText": "Array of allowed response types (optional, defaults to code)" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ { "type": "literal", "value": "none" }, { "type": "literal", "value": "client_secret_basic" }, { "type": "literal", "value": "client_secret_post" } ] }, "isOptional": true, "comment": { "shortText": "Token endpoint authentication method (defaults to server default if not specified)" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ { "type": "literal", "value": "public" }, { "type": "literal", "value": "confidential" } ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ { "type": "literal", "value": "dynamic" }, { "type": "literal", "value": "manual" } ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Creates a new OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "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": "Deletes an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminOAuthApi.getClient": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Gets details of a specific OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminOAuthApi.listClients": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients", "params": [ { "name": "params", "type": { "name": "PageParams", "type": "object", "properties": [ { "name": "page", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The page number" } }, { "name": "perPage", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Number of items returned per page" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "clients" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Lists all OAuth clients with optional pagination.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Regenerates the secret for an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient": { "name": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "UpdateOAuthClientParams", "type": "object", "properties": [ { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "isOptional": true, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Token endpoint authentication method" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates an existing OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey": { "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey", "params": [ { "name": "params", "type": { "name": "AuthPasskeyAdminDeleteParams", "type": "object", "properties": [ { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" } }, { "name": "userId", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyDeleteResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a specific passkey for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys": { "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys", "params": [ { "name": "params", "type": { "name": "AuthPasskeyAdminListParams", "type": "object", "properties": [ { "name": "userId", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "PasskeyListItem", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "last_used_at", "type": "[Circular]", "isOptional": true } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all passkeys registered for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/auth-js.GoTrueMFAApi.challenge": { "name": "@supabase/auth-js.GoTrueMFAApi.challenge", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeParamsBase" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "AuthMFAChallengeResponseBase" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } }, "comment": { "shortText": "Prepares a challenge used to verify that a user has access to a MFA\nfactor.", "text": "- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.", "examples": [ { "id": "create-a-challenge-for-a-factor", "name": "Create a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n})\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'totp',\n expires_at: 1700000000\n },\n error: null\n}\n```" }, { "id": "create-a-challenge-for-a-phone-factor", "name": "Create a challenge for a phone factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n expires_at: 1700000000\n },\n error: null\n}\n```" }, { "id": "create-a-challenge-for-a-phone-factor-whatsapp", "name": "Create a challenge for a phone factor (WhatsApp)", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n channel: 'whatsapp',\n})\n```", "response": "```json\n{\n data: {\n id: '',\n expires_at: 1700000000\n },\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengePhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "AuthMFAChallengeResponseBase" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeWebauthnParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAChallengeParams", "subTypes": [ { "type": "nameOnly", "name": "MFAChallengeTOTPParams" }, { "type": "nameOnly", "name": "MFAChallengePhoneParams" }, { "type": "nameOnly", "name": "MFAChallengeWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAChallengeResponse", "subTypes": [ { "type": "union", "name": "AuthMFAChallengeTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAChallengePhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAChallengeWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } ] } } } } ] }, "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify": { "name": "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeAndVerifyTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": { "type": "literal", "value": "bearer" }, "comment": { "shortText": "Type of token, always `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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", "text": "- Intended for use with only TOTP factors.\n- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.\n- Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.", "examples": [ { "id": "create-and-verify-a-challenge-for-a-factor", "name": "Create and verify a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challengeAndVerify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n code: '123456'\n})\n```", "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 ]\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\": \"example@email.com\",\n \"email_verified\": true,\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@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\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.GoTrueMFAApi.enroll": { "name": "@supabase/auth-js.GoTrueMFAApi.enroll", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the enrollment process for a new Multi-Factor Authentication (MFA)\nfactor. This method creates a new `unverified` factor.\nTo verify a factor, present the QR code or secret to the user and ask them to add it to their\nauthenticator app.\nThe user has to enter the code from their authenticator app to verify it.\n\nUpon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.", "text": "- Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.\n- To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).\n- To generate a QR code for the `totp` secret in Next.js, you can do the following:\n```html\n{data.totp.uri}\n```\n- The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.", "examples": [ { "id": "enroll-a-time-based-one-time-password-totp-factor", "name": "Enroll a time-based, one-time password (TOTP) factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'totp',\n friendlyName: 'your_friendly_name'\n})\n\n// Use the id to create a challenge.\n// The challenge can be verified by entering the code generated from the authenticator app.\n// The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.\nconst { id, type, totp: { qr_code, secret, uri }, friendly_name } = data\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'totp'\n totp: {\n qr_code: '',\n secret: '',\n uri: '',\n }\n friendly_name?: 'Important app'\n },\n error: null\n}\n```" }, { "id": "enroll-a-phone-factor", "name": "Enroll a Phone Factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'phone',\n friendlyName: 'your_friendly_name',\n phone: '+12345678',\n})\n\n// Use the id to create a challenge and send an SMS with a code to the user.\nconst { id, type, friendly_name, phone } = data\n\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n friendly_name?: 'Important app',\n phone: '+5787123456'\n },\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollPhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollPhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollParamsBase" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAEnrollParams", "subTypes": [ { "type": "nameOnly", "name": "MFAEnrollTOTPParams" }, { "type": "nameOnly", "name": "MFAEnrollPhoneParams" }, { "type": "nameOnly", "name": "MFAEnrollWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollResponse", "subTypes": [ { "type": "union", "name": "AuthMFAEnrollTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAEnrollPhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAEnrollWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } ] } } } } ] }, "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": { "name": "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel", "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": "AuthMFAGetAuthenticatorAssuranceLevelResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "currentAuthenticationMethods", "type": { "type": "union", "subTypes": [ { "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": "[Circular]", "comment": { "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." } } ] } }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "comment": { "shortText": "A list of all authentication methods attached to this session. Use\nthe information here to detect the last time a user verified a\nfactor, for example if implementing a step-up scenario.\n\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": "currentLevel", "type": { "type": "union", "subTypes": [ { "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ "[Circular]", "[Circular]", null ] }, { "type": "literal", "value": null } ] }, "comment": { "shortText": "Current AAL level of the session." } }, { "name": "nextLevel", "type": { "type": "union", "subTypes": [ { "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ "[Circular]", "[Circular]", null ] }, { "type": "literal", "value": null } ] }, "comment": { "shortText": "Next possible AAL level for the session. If the next level is higher\nthan the current one, the user should go through MFA." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Returns the Authenticator Assurance Level (AAL) for the active session.\n\n- `aal1` (or `null`) means that the user's identity has been verified only\nwith a conventional login (email+password, OTP, magic link, social login,\netc.).\n- `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.\n\nWhen called without a JWT parameter, this method is fairly quick (microseconds)\nand rarely uses the network. When a JWT is provided (useful in server-side\nenvironments like Edge Functions where no session is stored), this method\nwill make a network request to validate the user and fetch their MFA factors.", "text": "- Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.\n- In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.\n- If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.\n- An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.", "examples": [ { "id": "get-the-aal-details-of-a-session", "name": "Get the AAL details of a session", "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()\nconst { currentLevel, nextLevel, currentAuthenticationMethods } = data\n```", "response": "```json\n{\n data: {\n currentLevel: 'aal1',\n nextLevel: 'aal2',\n currentAuthenticationMethods: [\n {\n method: 'password',\n timestamp: 1700000000\n }\n ]\n }\n error: null\n}\n```" }, { "id": "get-the-aal-details-for-a-specific-jwt", "name": "Get the AAL details for a specific JWT", "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)\n```" } ] } }, "@supabase/auth-js.GoTrueMFAApi.listFactors": { "name": "@supabase/auth-js.GoTrueMFAApi.listFactors", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAListFactorsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Returns the list of MFA factors enabled for this user." } }, "@supabase/auth-js.GoTrueMFAApi.unenroll": { "name": "@supabase/auth-js.GoTrueMFAApi.unenroll", "params": [ { "name": "params", "type": { "name": "MFAUnenrollParams", "type": "object", "properties": [ { "name": "factorId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor being unenrolled." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAUnenrollResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor that was successfully unenrolled." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Unenroll removes a MFA factor.\nA user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.", "examples": [ { "id": "unenroll-a-factor", "name": "Unenroll a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.unenroll({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", "response": "```json\n{\n data: {\n id: ''\n },\n error: null\n}\n```" } ] } }, "@supabase/auth-js.GoTrueMFAApi.verify": { "name": "@supabase/auth-js.GoTrueMFAApi.verify", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a code against a challenge. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", "text": "- To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.", "examples": [ { "id": "verify-a-challenge-for-a-factor", "name": "Verify a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.verify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',\n code: '123456'\n})\n```", "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 ]\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\": \"example@email.com\",\n \"email_verified\": true,\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@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyPhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyWebauthnParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAVerifyParams", "subTypes": [ { "type": "nameOnly", "name": "MFAVerifyTOTPParams" }, { "type": "nameOnly", "name": "MFAVerifyPhoneParams" }, { "type": "nameOnly", "name": "MFAVerifyWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } } ] }, "@supabase/auth-js.isAuthApiError": { "name": "@supabase/auth-js.isAuthApiError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.isAuthError": { "name": "@supabase/auth-js.isAuthError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.isAuthImplicitGrantRedirectError": { "name": "@supabase/auth-js.isAuthImplicitGrantRedirectError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "any" } } ] }, "@supabase/auth-js.isAuthPKCECodeVerifierMissingError": { "name": "@supabase/auth-js.isAuthPKCECodeVerifierMissingError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.isAuthRefreshDiscardedError": { "name": "@supabase/auth-js.isAuthRefreshDiscardedError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.isAuthRetryableFetchError": { "name": "@supabase/auth-js.isAuthRetryableFetchError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.isAuthSessionMissingError": { "name": "@supabase/auth-js.isAuthSessionMissingError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "any" } } ] }, "@supabase/auth-js.isAuthWeakPasswordError": { "name": "@supabase/auth-js.isAuthWeakPasswordError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/auth-js.navigatorLock": { "name": "@supabase/auth-js.navigatorLock", "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. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." } }, { "name": "fn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } } }, "comment": { "shortText": "The operation to run once the lock is acquired." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } }, "comment": { "shortText": "Implements a global exclusive lock using the Navigator LockManager API. It\nis available on all browsers released after 2022-03-15 with Safari being the\nlast one to release support. If the API is not available, this function will\nthrow. Make sure you check availablility before configuring GoTrueClient.\n\nYou can turn on debugging by setting the `supabase.gotrue-js.locks.debug`\nlocal storage item to `true`.\n\nInternals:\n\nSince the LockManager API does not preserve stack traces for the async\nfunction passed in the `request` method, a trick is used where acquiring the\nlock releases a previously started promise to run the operation in the `fn`\nfunction. The lock waits for that promise to finish (with or without error),\nwhile the function will finally wait for the result anyway." } }, "@supabase/auth-js.processLock": { "name": "@supabase/auth-js.processLock", "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. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." } }, { "name": "fn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } } }, "comment": { "shortText": "The operation to run once the lock is acquired." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } }, "comment": { "shortText": "Implements a global exclusive lock that works only in the current process.\nUseful for environments like React Native or other non-browser\nsingle-process (i.e. no concept of \"tabs\") environments.\n\nUse #navigatorLock in browser environments.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nawait processLock('migrate', 5000, async () => {\n await runMigration()\n})\n```" } ] } }, "@supabase/postgrest-js.PostgrestBuilder.constructor": { "name": "@supabase/postgrest-js.PostgrestBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "HEAD" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/postgrest-js.PostgrestBuilder.overrideTypes": { "name": "@supabase/postgrest-js.PostgrestBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/postgrest-js.PostgrestBuilder.retry": { "name": "@supabase/postgrest-js.PostgrestBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/postgrest-js.PostgrestBuilder.returns": { "name": "@supabase/postgrest-js.PostgrestBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`." } }, "@supabase/postgrest-js.PostgrestBuilder.setHeader": { "name": "@supabase/postgrest-js.PostgrestBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestBuilder.stripNulls": { "name": "@supabase/postgrest-js.PostgrestBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestBuilder.then": { "name": "@supabase/postgrest-js.PostgrestBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/postgrest-js.PostgrestBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/postgrest-js.PostgrestClient.constructor": { "name": "@supabase/postgrest-js.PostgrestClient.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the PostgREST endpoint" } }, { "name": "options", "type": { "type": "object", "properties": [ { "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, "comment": { "shortText": "Custom fetch" } }, { "name": "headers", "type": { "type": "nameOnly", "name": "HeadersInit" }, "isOptional": true, "comment": { "shortText": "Custom headers" } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Enable or disable automatic retries for transient errors.\n When enabled, idempotent requests (GET, HEAD, OPTIONS) that fail with network\n errors or HTTP 503/520 responses will be automatically retried up to 3 times\n with exponential backoff (1s, 2s, 4s). Defaults to `true`." } }, { "name": "schema", "type": { "type": "nameOnly", "name": "@supabase/postgrest-js.default.SchemaName" }, "isOptional": true, "comment": { "shortText": "Postgres schema to switch to" } }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Optional timeout in milliseconds for all requests. When set, requests will automatically abort after this duration to prevent indefinite hangs." } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum URL length in characters before warnings/errors are triggered. Defaults to 8000." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestClient" } }, "comment": { "shortText": "Creates a PostgREST client.", "text": "- A `timeout` option (in milliseconds) can be set to automatically abort requests that take too long.\n- A `urlLengthLimit` option (default: 8000) can be set to control when URL length warnings are included in error messages for aborted requests.", "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.from('profiles').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestClient } from '@supabase/postgrest-js'\n\nconst postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {\n headers: { apikey: 'your-publishable-key' },\n schema: 'public',\n timeout: 30000, // 30 second timeout\n})\n```" } ] } }, "@supabase/postgrest-js.PostgrestClient.from": { "name": "@supabase/postgrest-js.PostgrestClient.from", "params": [ { "name": "relation", "type": { "type": "nameOnly", "name": "TableName" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } }, "comment": { "shortText": "Perform a query on a table or a view." }, "altSignatures": [ { "params": [ { "name": "relation", "type": { "type": "nameOnly", "name": "ViewName" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } } } ] }, "@supabase/postgrest-js.PostgrestClient.rpc": { "name": "@supabase/postgrest-js.PostgrestClient.rpc", "params": [ { "name": "fn", "type": { "type": "nameOnly", "name": "FnName" }, "comment": { "shortText": "The function name to call" } }, { "name": "args", "type": { "type": "nameOnly", "name": "Args" }, "comment": { "shortText": "The arguments to pass to the function call" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count rows returned by the\nfunction. Only applicable for [set-returning\nfunctions](https://www.postgresql.org/docs/current/functions-srf.html).\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "get", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, the function will be called with\nread-only access mode." } }, { "name": "head", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a function call.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// For cross-schema functions where type inference fails, use overrideTypes:\nconst { data } = await supabase\n .schema('schema_b')\n .rpc('function_a', {})\n .overrideTypes<{ id: string; user_id: string }[]>()\n```" }, { "id": "call-a-postgres-function-without-arguments", "name": "Call a Postgres function without arguments", "code": "```ts\nconst { data, error } = await supabase.rpc('hello_world')\n```", "data": { "sql": "```sql\ncreate function hello_world() returns text as $$\n select 'Hello world';\n$$ language sql;\n```" }, "response": "```json\n{\n \"data\": \"Hello world\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "call-a-postgres-function-with-arguments", "name": "Call a Postgres function with arguments", "code": "```ts\nconst { data, error } = await supabase.rpc('echo', { say: '👋' })\n```", "data": { "sql": "```sql\ncreate function echo(say text) returns text as $$\n select say;\n$$ language sql;\n```" }, "response": "```json\n {\n \"data\": \"👋\",\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" }, { "id": "bulk-processing", "name": "Bulk processing", "code": "```ts\nconst { data, error } = await supabase.rpc('add_one_each', { arr: [1, 2, 3] })\n```", "description": "You can process large payloads by passing in an array as an argument.", "data": { "sql": "```sql\ncreate function add_one_each(arr int[]) returns int[] as $$\n select array_agg(n + 1) from unnest(arr) as n;\n$$ language sql;\n```" }, "response": "```json\n{\n \"data\": [\n 2,\n 3,\n 4\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "call-a-postgres-function-with-filters", "name": "Call a Postgres function with filters", "code": "```ts\nconst { data, error } = await supabase\n .rpc('list_stored_countries')\n .eq('id', 1)\n .single()\n```", "description": "Postgres functions that return tables can also be combined with [Filters](/docs/reference/javascript/using-filters) and [Modifiers](/docs/reference/javascript/using-modifiers).", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'),\n (2, 'The Shire');\n\ncreate function list_stored_countries() returns setof countries as $$\n select * from countries;\n$$ language sql;\n```" }, "response": "```json\n{\n \"data\": {\n \"id\": 1,\n \"name\": \"Rohan\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "call-a-read-only-postgres-function", "name": "Call a read-only Postgres function", "code": "```ts\nconst { data, error } = await supabase.rpc('hello_world', undefined, { get: true })\n```", "data": { "sql": "```sql\ncreate function hello_world() returns text as $$\n select 'Hello world';\n$$ language sql;\n```" }, "response": "```json\n{\n \"data\": \"Hello world\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestClient.schema": { "name": "@supabase/postgrest-js.PostgrestClient.schema", "params": [ { "name": "schema", "type": { "type": "nameOnly", "name": "DynamicSchema" }, "comment": { "shortText": "The schema to query" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestClient" } }, "comment": { "shortText": "Select a schema to query or perform an function (rpc) call.\n\nThe schema needs to be on the list of exposed schemas inside Supabase." } }, "@supabase/postgrest-js.PostgrestError.constructor": { "name": "@supabase/postgrest-js.PostgrestError.constructor", "params": [ { "name": "context", "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "intrinsic", "name": "string" } }, { "name": "details", "type": { "type": "intrinsic", "name": "string" } }, { "name": "hint", "type": { "type": "intrinsic", "name": "string" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestError" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nimport PostgrestError from '@supabase/postgrest-js'\n\nthrow new PostgrestError({\n message: 'Row level security prevented the request',\n details: 'RLS denied the insert',\n hint: 'Check your policies',\n code: 'PGRST301',\n})\n```" } ] } }, "@supabase/postgrest-js.PostgrestError.toJSON": { "name": "@supabase/postgrest-js.PostgrestError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "intrinsic", "name": "string" } }, { "name": "details", "type": { "type": "intrinsic", "name": "string" } }, { "name": "hint", "type": { "type": "intrinsic", "name": "string" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" } } ] } } }, "@supabase/postgrest-js.PostgrestFilterBuilder.constructor": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "HEAD" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal", "params": [ { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "comment": { "shortText": "The AbortSignal to use for the fetch request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set the AbortSignal for the fetch request.", "text": "You can use this to set a timeout for the request.", "examples": [ { "id": "aborting-requests-in-flight", "name": "Aborting requests in-flight", "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" }, { "id": "set-a-timeout", "name": "Set a timeout", "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\nevery element appearing in `column` is contained by `value`.", "examples": [ { "id": "on-array-columns", "name": "On array columns", "code": "```ts\nconst { data, error } = await supabase\n .from('classes')\n .select('name')\n .containedBy('days', ['monday', 'tuesday', 'wednesday', 'friday'])\n```", "data": { "sql": "```sql\ncreate table\n classes (\n id int8 primary key,\n name text,\n days text[]\n );\n\ninsert into\n classes (id, name, days)\nvalues\n (1, 'Chemistry', array['monday', 'friday']),\n (2, 'History', array['monday', 'wednesday', 'thursday']);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Chemistry\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-range-columns", "name": "On range columns", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .containedBy('during', '[2000-01-01 00:00, 2000-01-01 23:59)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-jsonb-columns", "name": "On `jsonb` columns", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select('name')\n .containedBy('address', {})\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, \"street\": \"Melrose Place\" }'),\n (2, 'Jane', '{}');\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Jane\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.contains": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.contains", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\n`column` contains every element appearing in `value`.", "examples": [ { "id": "on-array-columns", "name": "On array columns", "code": "```ts\nconst { data, error } = await supabase\n .from('issues')\n .select()\n .contains('tags', ['is:open', 'priority:low'])\n```", "data": { "sql": "```sql\ncreate table\n issues (\n id int8 primary key,\n title text,\n tags text[]\n );\n\ninsert into\n issues (id, title, tags)\nvalues\n (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"title\": \"Cache invalidation is not working\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-range-columns", "name": "On range columns", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .contains('during', '[2000-01-01 13:00, 2000-01-01 13:30)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-jsonb-columns", "name": "On `jsonb` columns", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select('name')\n .contains('address', { postcode: 90210 })\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, \"street\": \"Melrose Place\" }'),\n (2, 'Jane', '{}');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Michael\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.csv": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.csv", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a string in CSV format.", "examples": [ { "id": "return-data-as-csv", "name": "Return data as CSV", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.eq": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.eq", "params": [ { "name": "column", "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is equal to `value`.\n\nTo check if the value of `column` is NULL, you should use `.is()` instead.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Leia')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.explain": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.explain", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "analyze", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" } }, { "name": "buffers", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on buffer usage" } }, { "name": "format", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "text" }, { "type": "literal", "value": "json" } ] }, "isOptional": true, "comment": { "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" } }, { "name": "settings", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on configuration\nparameters that affect query planning" } }, { "name": "verbose", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" } }, { "name": "wal", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on WAL record generation" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "PostgrestBuilder" }, { "type": "nameOnly", "name": "PostgrestBuilder" } ] } }, "comment": { "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", "examples": [ { "id": "get-the-execution-plan", "name": "Get the execution plan", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" }, { "id": "get-the-execution-plan-with-analyze-and-verbose", "name": "Get the execution plan with analyze and verbose", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.filter": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.filter", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "FilterOperator" }, { "type": "literal", "value": "not.match" }, { "type": "literal", "value": "not.is" }, { "type": "literal", "value": "not.eq" }, { "type": "literal", "value": "not.neq" }, { "type": "literal", "value": "not.gt" }, { "type": "literal", "value": "not.gte" }, { "type": "literal", "value": "not.lt" }, { "type": "literal", "value": "not.lte" }, { "type": "literal", "value": "not.like" }, { "type": "literal", "value": "not.ilike" }, { "type": "literal", "value": "not.isdistinct" }, { "type": "literal", "value": "not.in" }, { "type": "literal", "value": "not.cs" }, { "type": "literal", "value": "not.cd" }, { "type": "literal", "value": "not.sl" }, { "type": "literal", "value": "not.sr" }, { "type": "literal", "value": "not.nxl" }, { "type": "literal", "value": "not.nxr" }, { "type": "literal", "value": "not.adj" }, { "type": "literal", "value": "not.ov" }, { "type": "literal", "value": "not.fts" }, { "type": "literal", "value": "not.plfts" }, { "type": "literal", "value": "not.phfts" }, { "type": "literal", "value": "not.wfts" }, { "type": "literal", "value": "not.imatch" } ] } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows which satisfy the filter. This is an escape hatch - you\nshould use the specific filter methods wherever possible.\n\nUnlike most filters, `opearator` and `value` are used as-is and need to\nfollow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure they are properly sanitized.", "text": "filter() expects you to use the raw PostgREST syntax for the filter values.\n\n```ts\n.filter('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n.filter('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n```", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .filter('name', 'in', '(\"Han\",\"Yoda\")')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .filter('instruments.name', 'eq', 'flute')\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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "operator", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.geojson": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.gt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.gt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is greater than `value`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .gt('id', 2)\n```", "description": "When using [reserved words](https://www.postgresql.org/docs/current/sql-keywords-appendix.html) for column names you need\nto add double quotes e.g. `.gt('\"order\"', 2)`", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.gte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.gte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is greater than or equal to `value`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .gte('id', 2)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilike": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches `pattern` case-insensitively.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .ilike('name', '%lu%')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches all of `patterns` case-insensitively." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches any of `patterns` case-insensitively." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.in": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.in", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "values", "type": { "type": "array" }, "comment": { "shortText": "The values array to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is included in the `values` array.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .in('name', ['Leia', 'Han'])\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.is": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.is", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value" } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` IS `value`.\n\nFor non-boolean columns, this is only relevant for checking if the value of\n`column` is NULL by setting `value` to `null`.\n\nFor boolean columns, you can also set `value` to `true` or `false` and it\nwill behave the same way as `.eq()`.", "examples": [ { "id": "checking-for-nullness-true-or-false", "name": "Checking for nullness, true or false", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .select()\n .is('name', null)\n```", "description": "Using the `eq()` filter doesn't work when filtering for `null`.\n\nInstead, you need to use `is()`.", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'null'),\n (2, null);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"null\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "boolean" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.isDistinct": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.isDistinct", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` IS DISTINCT FROM `value`.\n\nUnlike `.neq()`, this treats `NULL` as a comparable value. Two `NULL` values\nare considered equal (not distinct), and comparing `NULL` with any non-NULL\nvalue returns true (distinct)." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.like": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.like", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches `pattern` case-sensitively.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .like('name', '%Lu%')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches all of `patterns` case-sensitively." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches any of `patterns` case-sensitively." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.limit": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.limit", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows to return" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by `rows`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\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');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.lt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.lt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is less than `value`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .lt('id', 2)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.lte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.lte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is less than or equal to `value`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .lte('id', 2)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.match": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.match", "params": [ { "name": "query", "type": { "type": "record", "name": "Record", "keyType": { "type": "nameOnly", "name": "ColumnName" }, "valueType": { "type": "nameOnly", "name": "Row['ColumnName']" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where each column in `query` keys is equal to its\nassociated value. Shorthand for multiple `.eq()`s.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .match({ id: 2, name: 'Leia' })\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "query", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows that can be affected" } } ], "comment": { "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.neq": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.neq", "params": [ { "name": "column", "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is not equal to `value`.\n\nThis filter does not include rows where `column` is `NULL`. To match null\nvalues, use `.is(column, null)` instead.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .neq('name', 'Leia')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.not": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.not", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "literal", "value": "is" } }, { "name": "value", "type": { "type": "literal", "value": null } } ], "comment": { "shortText": "Match only rows which doesn't satisfy the filter.\n\nUnlike most filters, `opearator` and `value` are used as-is and need to\nfollow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure they are properly sanitized.", "text": "not() expects you to use the raw PostgREST syntax for the filter values.\n\n```ts\n.not('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n.not('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n```", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .select()\n .not('name', 'is', null)\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'null'),\n (2, null);\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"null\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "nameOnly", "name": "FilterOperator" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "operator", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.notIn": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.notIn", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "values", "type": { "type": "array" }, "comment": { "shortText": "The values array to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is NOT included in the `values` array." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.or": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.or", "params": [ { "name": "filters", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The filters to use, following PostgREST syntax" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `referencedTable` instead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to filter on referenced tables\ninstead of the parent table" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows which satisfy at least one of the filters.\n\nUnlike most filters, `filters` is used as-is and needs to follow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure it's properly sanitized.\n\nIt's currently not possible to do an `.or()` filter across multiple tables.", "text": "or() expects you to use the raw PostgREST syntax for the filter names and values.\n\n```ts\n.or('id.in.(5,6,7), arraycol.cs.{\"a\",\"b\"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.\n.or('id.in.(5,6,7), arraycol.cd.{\"a\",\"b\"}') // Use `cd` for `containedBy()`\n```", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.eq.2,name.eq.Han')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n },\n {\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "use-or-with-and", "name": "Use `or` with `and`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.gt.3,and(id.eq.1,name.eq.Luke)')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "use-or-on-referenced-tables", "name": "Use `or` on 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 .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })\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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.order": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.order", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Order the query result by `column`.\n\nYou can call this method multiple times to order by multiple columns.\n\nYou can order referenced tables, but it only affects the ordering of the\nparent table if you use `!inner` in the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('id, name')\n .order('id', { ascending: false })\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\n const { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .order('name', { referencedTable: 'instruments', ascending: false })\n\n```", "description": "Ordering with `referencedTable` doesn't affect the ordering of the\nparent table.", "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, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n },\n {\n \"name\": \"harp\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": []\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "order-parent-table-by-a-referenced-table", "name": "Order parent table by a referenced table", "code": "```ts\n const { data, error } = await supabase\n .from('instruments')\n .select(`\n name,\n section:orchestral_sections (\n name\n )\n `)\n .order('section(name)', { ascending: true })\n\n```", "description": "Ordering with `referenced_table(col)` affects the ordering of the\nparent table.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"violin\",\n \"orchestral_sections\": {\"name\": \"strings\"}\n },\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for array and range columns. Match only rows where\n`column` and `value` have an element in common.", "examples": [ { "id": "on-array-columns", "name": "On array columns", "code": "```ts\nconst { data, error } = await supabase\n .from('issues')\n .select('title')\n .overlaps('tags', ['is:closed', 'severity:high'])\n```", "data": { "sql": "```sql\ncreate table\n issues (\n id int8 primary key,\n title text,\n tags text[]\n );\n\ninsert into\n issues (id, title, tags)\nvalues\n (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"title\": \"Cache invalidation is not working\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-range-columns", "name": "On range columns", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .overlaps('during', '[2000-01-01 12:45, 2000-01-01 13:15)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.overrideTypes": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.range": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.range", "params": [ { "name": "from", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The starting index from which to limit the result" } }, { "name": "to", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The last index to which to limit the result" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for range columns. Match only rows where `column` is\nmutually exclusive to `range` and there can be no element between the two\nranges.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeAdjacent('during', '[2000-01-01 12:00, 2000-01-01 13:00)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is greater than any element in `range`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeGt('during', '[2000-01-02 08:00, 2000-01-02 09:00)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"id\": 2,\n \"room_name\": \"Topaz\",\n \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is either contained in `range` or greater than any element in\n`range`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeGte('during', '[2000-01-02 08:30, 2000-01-02 09:30)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"id\": 2,\n \"room_name\": \"Topaz\",\n \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is less than any element in `range`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeLt('during', '[2000-01-01 15:00, 2000-01-01 16:00)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is either contained in `range` or less than any element in\n`range`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeLte('during', '[2000-01-01 14:00, 2000-01-01 16:00)')\n```", "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", "data": { "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.regexIMatch": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.regexIMatch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches the PostgreSQL regex `pattern`\ncase-insensitively (using the `~*` operator)." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.regexMatch": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.regexMatch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` matches the PostgreSQL regex `pattern`\ncase-sensitively (using the `~` operator)." }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.retry": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.returns": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`.", "text": "- Deprecated: use overrideTypes method instead", "examples": [ { "id": "override-type-of-successful-response", "name": "Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", "response": "```js\nlet x: typeof data // MyType[]\n```" }, { "id": "override-type-of-object-response", "name": "Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", "response": "```js\nlet x: typeof data // MyType | null\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.rollback": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", "examples": [ { "id": "validate-an-insert-without-persisting", "name": "Validate an insert without persisting", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.select": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", "examples": [ { "id": "with-upsert", "name": "With `upsert()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.setHeader": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.single": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.single", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.stripNulls": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "query", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "config", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "plain" }, { "type": "literal", "value": "phrase" }, { "type": "literal", "value": "websearch" } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Only relevant for text and tsvector columns. Match only rows where\n`column` matches the query string in `query`.", "text": "- For more information, see [Postgres full text search](/docs/guides/database/full-text-search).", "examples": [ { "id": "text-search", "name": "Text search", "code": "```ts\nconst result = await supabase\n .from(\"texts\")\n .select(\"content\")\n .textSearch(\"content\", `'eggs' & 'ham'`, {\n config: \"english\",\n });\n```", "data": { "sql": "```sql\ncreate table texts (\n id bigint\n primary key\n generated always as identity,\n content text\n);\n\ninsert into texts (content) values\n ('Four score and seven years ago'),\n ('The road goes ever on and on'),\n ('Green eggs and ham')\n;\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"content\": \"Green eggs and ham\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "basic-normalization", "name": "Basic normalization", "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat' & 'cat'`, {\n type: 'plain',\n config: 'english'\n })\n```", "description": "Uses PostgreSQL's `plainto_tsquery` function." }, { "id": "full-normalization", "name": "Full normalization", "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat' & 'cat'`, {\n type: 'phrase',\n config: 'english'\n })\n```", "description": "Uses PostgreSQL's `phraseto_tsquery` function." }, { "id": "websearch", "name": "Websearch", "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat or cat'`, {\n type: 'websearch',\n config: 'english'\n })\n```", "description": "Uses PostgreSQL's `websearch_to_tsquery` function.\nThis function will never raise syntax errors, which makes it possible to use raw user-supplied input for search, and can be used\nwith advanced operators.\n\n- `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery.\n- `\"quoted text\"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery.\n- `OR`: the word “or” will be converted to the | operator.\n- `-`: a dash will be converted to the ! operator." } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "query", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "config", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "plain" }, { "type": "literal", "value": "phrase" }, { "type": "literal", "value": "websearch" } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.then": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/postgrest-js.PostgrestQueryBuilder.constructor": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.constructor", "params": [ { "name": "url", "type": { "type": "nameOnly", "name": "URL" }, "comment": { "shortText": "The URL for the query" } }, { "name": "options", "type": { "type": "object", "properties": [ { "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, "comment": { "shortText": "Custom fetch implementation" } }, { "name": "headers", "type": { "type": "nameOnly", "name": "HeadersInit" }, "isOptional": true, "comment": { "shortText": "Custom headers" } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Enable automatic retries for transient errors (default: true)" } }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Postgres schema to use" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum URL length before warning" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } }, "comment": { "shortText": "Creates a query builder scoped to a Postgres table or view.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst query = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: { apikey: 'your-publishable-key' }, retry: true }\n)\n```" } ] } }, "@supabase/postgrest-js.PostgrestQueryBuilder.delete": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.delete", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count deleted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a DELETE on the table or view.\n\nBy default, deleted rows are not returned. To return it, chain the call\nwith `.select()` after filters.", "text": "- `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.\n- If you use `delete()` with filters and you have\n [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only\n rows visible through `SELECT` policies are deleted. Note that by default\n no rows are visible, so you need at least one `SELECT`/`ALL` policy that\n makes the rows visible.\n- When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.", "examples": [ { "id": "delete-a-single-record", "name": "Delete a single record", "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('countries').delete().eq('id', 1)\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT DELETE ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "delete-a-record-and-return-it", "name": "Delete a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n .select()\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "delete-multiple-records", "name": "Delete multiple records", "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .in('id', [1, 2, 3])\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestQueryBuilder.insert": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.insert", "params": [ { "name": "values", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "RejectExcessProperties" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "RejectExcessProperties" } } ] }, "comment": { "shortText": "The values to insert. Pass an object to insert a single row\nor an array to insert multiple rows." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count inserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "defaultToNull", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. Only applies for bulk\ninserts." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an INSERT into the table or view.\n\nBy default, inserted rows are not returned. To return it, chain the call\nwith `.select()`.", "examples": [ { "id": "create-a-record", "name": "Create a record", "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('countries').insert({ id: 1, name: 'Mordor' })\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "create-a-record-and-return-it", "name": "Create a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "bulk-create", "name": "Bulk create", "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert([\n { id: 1, name: 'Mordor' },\n { id: 1, name: 'The Shire' },\n ])\n```", "description": "A bulk create operation is handled in a single transaction.\nIf any of the inserts fail, none of the rows are inserted.", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (id)=(1) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"countries_pkey\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestQueryBuilder.select": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count rows in the table or view.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "head", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT query on the table or view.", "text": "When using `count` with `.range()` or `.limit()`, the returned `count` is the total number of rows\nthat match your filters, not the number of rows in the current page. Use this to build pagination UI.\n\n- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](/dashboard/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data.\n- `select()` can be combined with [Filters](/docs/reference/javascript/using-filters)\n- `select()` can be combined with [Modifiers](/docs/reference/javascript/using-modifiers)\n- `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465). *", "examples": [ { "id": "getting-your-data", "name": "Getting your data", "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Harry'),\n (2, 'Frodo'),\n (3, 'Katniss');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Harry\"\n },\n {\n \"id\": 2,\n \"name\": \"Frodo\"\n },\n {\n \"id\": 3,\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.from('characters').select()\nif (error) {\n // Logs the full error: message, code, details, and hint.\n console.error(error)\n return\n}\n```", "description": "The most useful field on a Postgres error is usually `hint` — when the database knows the fix, it puts the literal SQL there. For example, a permission-denied error (`code: '42501'`) arrives with a `hint` like `\"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\"`. Log the full `error` object so the hint isn't hidden behind `error.message`.", "response": "```json\n{\n \"error\": {\n \"code\": \"42501\",\n \"details\": null,\n \"hint\": \"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\",\n \"message\": \"permission denied for table characters\"\n },\n \"status\": 401,\n \"statusText\": \"Unauthorized\"\n}\n```" }, { "id": "selecting-specific-columns", "name": "Selecting specific columns", "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Frodo'),\n (2, 'Harry'),\n (3, 'Katniss');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Frodo\"\n },\n {\n \"name\": \"Harry\"\n },\n {\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables", "name": "Query referenced tables", "code": "```js\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n```", "description": "If your database has foreign key relationships, you can query related tables too.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables-with-spaces-in-their-names", "name": "Query referenced tables with spaces in their names", "code": "```js\nconst { data, error } = await supabase\n .from('orchestral sections')\n .select(`\n name,\n \"musical instruments\" (\n name\n )\n `)\n```", "description": "If your table name contains spaces, you must use double quotes in the `select` statement to reference the table.", "data": { "sql": "```sql\ncreate table\n \"orchestral sections\" (id int8 primary key, name text);\ncreate table\n \"musical 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 \"musical instruments\" (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"musical instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"musical instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables-through-a-join-table", "name": "Query referenced tables through a join table", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n name,\n teams (\n name\n )\n `)\n \n```", "description": "If you're in a situation where your tables are **NOT** directly\nrelated, but instead are joined by a _join table_, you can still use\nthe `select()` method to query the related data. The join table needs\nto have the foreign keys as part of its composite primary key.", "data": { "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n -- both foreign keys must be part of a composite primary key\n primary key (user_id, team_id)\n );\n\ninsert into\n users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Kiran\",\n \"teams\": [\n {\n \"name\": \"Green\"\n },\n {\n \"name\": \"Blue\"\n }\n ]\n },\n {\n \"name\": \"Evan\",\n \"teams\": [\n {\n \"name\": \"Blue\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n \n```" }, { "id": "query-the-same-referenced-table-multiple-times", "name": "Query the same referenced table multiple times", "code": "```ts\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:sender_id(name),\n to:receiver_id(name)\n `)\n\n// To infer types, use the name of the table (in this case `users`) and\n// the name of the foreign key constraint.\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:users!messages_sender_id_fkey(name),\n to:users!messages_receiver_id_fkey(name)\n `)\n```", "description": "If you need to query the same referenced table twice, use the name of the\njoined column to identify which join to use. You can also give each\ncolumn an alias.", "data": { "sql": "```sql\n create table\n users (id int8 primary key, name text);\n\n create table\n messages (\n sender_id int8 not null references users,\n receiver_id int8 not null references users,\n content text\n );\n\n insert into\n users (id, name)\n values\n (1, 'Kiran'),\n (2, 'Evan');\n\n insert into\n messages (sender_id, receiver_id, content)\n values\n (1, 2, '👋');\n ```\n```\n\n@exampleResponse Query the same referenced table multiple times\n```json\n{\n \"data\": [\n {\n \"content\": \"👋\",\n \"from\": {\n \"name\": \"Kiran\"\n },\n \"to\": {\n \"name\": \"Evan\"\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n\n@exampleDescription Query nested foreign tables through a join table\nYou can use the result of a joined table to gather data in\nanother foreign table. With multiple references to the same foreign\ntable you must specify the column on which to conduct the join.\n\n@example Query nested foreign tables through a join table\n```ts\n const { data, error } = await supabase\n .from('games')\n .select(`\n game_id:id,\n away_team:teams!games_away_team_fkey (\n users (\n id,\n name\n )\n )\n `)\n \n```\n\n@exampleSql Query nested foreign tables through a join table\n```sql\n```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n\n primary key (user_id, team_id)\n );\ncreate table\n games (\n id int8 primary key,\n home_team int8 not null references teams,\n away_team int8 not null references teams,\n name text\n );\n\ninsert into users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\ninsert into\n games (id, home_team, away_team, name)\nvalues\n (1, 1, 2, 'Green vs Blue'),\n (2, 2, 1, 'Blue vs Green');\n```" } }, { "id": "filtering-through-referenced-tables", "name": "Filtering through referenced tables", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections(*)')\n .eq('orchestral_sections.name', 'percussion')\n```", "description": "If the filter on a referenced table's column is not satisfied, the referenced\ntable returns `[]` or `null` but the parent table is not filtered out.\nIf you want to filter out the parent table rows, use the `!inner` hint", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": null\n },\n {\n \"name\": \"violin\",\n \"orchestral_sections\": null\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-referenced-table-with-count", "name": "Querying referenced table with count", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`*, instruments(count)`)\n```", "description": "You can get the number of rows in a related table by using the\n**count** property.", "data": { "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table characters (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('strings') returning id\n)\ninsert into instruments (name, section_id) values\n('violin', (select id from section)),\n('viola', (select id from section)),\n('cello', (select id from section)),\n('double bass', (select id from section));\n```" }, "response": "```json\n[\n {\n \"id\": \"693694e7-d993-4360-a6d7-6294e325d9b6\",\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"count\": 4\n }\n ]\n }\n]\n```" }, { "id": "querying-with-count-option", "name": "Querying with count option", "code": "```ts\nconst { count, error } = await supabase\n .from('characters')\n .select('*', { count: 'exact', head: true })\n```", "description": "You can get the number of rows by using the\n[count](/docs/reference/javascript/select#parameters) option.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"count\": 3,\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-json-data", "name": "Querying JSON data", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n id, name,\n address->city\n `)\n```", "description": "You can select and filter data inside of\n[JSON](/docs/guides/database/json) columns. Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nquerying JSON data.", "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, 'Frodo', '{\"city\":\"Hobbiton\"}');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Frodo\",\n \"city\": \"Hobbiton\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-referenced-table-with-inner-join", "name": "Querying referenced table with inner join", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections!inner(name)')\n .eq('orchestral_sections.name', 'woodwinds')\n .limit(1)\n```", "description": "If you don't want to return the referenced table contents, you can leave the parenthesis empty.\nLike `.select('name, orchestral_sections!inner()')`.", "data": { "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table instruments (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('woodwinds') returning id\n)\ninsert into instruments (name, section_id) values\n('flute', (select id from section)),\n('clarinet', (select id from section)),\n('bassoon', (select id from section)),\n('piccolo', (select id from section));\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "switching-schemas-per-query", "name": "Switching schemas per query", "code": "```ts\nconst { data, error } = await supabase\n .schema('myschema')\n .from('mytable')\n .select()\n```", "description": "In addition to setting the schema during initialization, you can also switch schemas on a per-query basis.\nMake sure you've set up your [database privileges and API settings](/docs/guides/api/using-custom-schemas).", "data": { "sql": "```sql\ncreate schema myschema;\n\ncreate table myschema.mytable (\n id uuid primary key default gen_random_uuid(),\n data text\n);\n\ninsert into myschema.mytable (data) values ('mydata');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": \"4162e008-27b0-4c0f-82dc-ccaeee9a624d\",\n \"data\": \"mydata\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestQueryBuilder.update": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.update", "params": [ { "name": "values", "type": { "type": "nameOnly", "name": "RejectExcessProperties" }, "comment": { "shortText": "The values to update with" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count updated rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an UPDATE on the table or view.\n\nBy default, updated rows are not returned. To return it, chain the call\nwith `.select()` after filters.", "text": "- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update.", "examples": [ { "id": "updating-your-data", "name": "Updating your data", "code": "```ts\nconst { error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('instruments').update({ name: 'piano' }).eq('id', 1)\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "update-a-record-and-return-it", "name": "Update a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "updating-json-data", "name": "Updating JSON data", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .update({\n address: {\n street: 'Melrose Place',\n postcode: 90210\n }\n })\n .eq('address->postcode', 90210)\n .select()\n```", "description": "Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nworking with JSON data. Currently, it is only possible to update the entire JSON document.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"street\": \"Melrose Place\",\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestQueryBuilder.upsert": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.upsert", "params": [ { "name": "values", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "RejectExcessProperties" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "RejectExcessProperties" } } ] }, "comment": { "shortText": "The values to upsert with. Pass an object to upsert a\nsingle row or an array to upsert multiple rows." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ null, { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count upserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "defaultToNull", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. This only applies when\ninserting new rows, not when merging with existing rows under\n`ignoreDuplicates: false`. This also only applies when doing bulk upserts." } }, { "name": "ignoreDuplicates", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, duplicate rows are ignored. If\n`false`, duplicate rows are merged with existing rows." } }, { "name": "onConflict", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Comma-separated UNIQUE column(s) to specify how\nduplicate rows are determined. Two rows are duplicates if all the\n`onConflict` columns are equal." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\nto `onConflict`, `.upsert()` allows you to perform the equivalent of\n`.insert()` if a row with the corresponding `onConflict` columns doesn't\nexist, or if it does exist, perform an alternative action depending on\n`ignoreDuplicates`.\n\nBy default, upserted rows are not returned. To return it, chain the call\nwith `.select()`.", "text": "- Primary keys must be included in `values` to use upsert.", "examples": [ { "id": "upsert-a-single-row-using-a-unique-key", "name": "Upsert a single row using a unique key", "code": "```ts\n// Upserting a single row, overwriting based on the 'username' unique column\nconst { data, error } = await supabase\n .from('users')\n .upsert({ username: 'supabot' }, { onConflict: 'username' })\n\n// Example response:\n// {\n// data: [\n// { id: 4, message: 'bar', username: 'supabot' }\n// ],\n// error: null\n// }\n```" }, { "id": "upsert-with-conflict-resolution-and-exact-row-counting", "name": "Upsert with conflict resolution and exact row counting", "code": "```ts\n// Upserting and returning exact count\nconst { data, error, count } = await supabase\n .from('users')\n .upsert(\n {\n id: 3,\n message: 'foo',\n username: 'supabot'\n },\n {\n onConflict: 'username',\n count: 'exact'\n }\n )\n\n// Example response:\n// {\n// data: [\n// {\n// id: 42,\n// handle: \"saoirse\",\n// display_name: \"Saoirse\"\n// }\n// ],\n// count: 1,\n// error: null\n// }\n```" }, { "id": "upsert-your-data", "name": "Upsert your data", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert({ id: 1, name: 'piano' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.from('instruments').upsert({ id: 1, name: 'piano' }).select()\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT, UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "bulk-upsert-your-data", "name": "Bulk Upsert your data", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert([\n { id: 1, name: 'piano' },\n { id: 2, name: 'harp' },\n ])\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n },\n {\n \"id\": 2,\n \"name\": \"harp\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "upserting-into-tables-with-constraints", "name": "Upserting into tables with constraints", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .upsert({ id: 42, handle: 'saoirse', display_name: 'Saoirse' })\n .select()\n```", "description": "In the following query, `upsert()` implicitly uses the `id`\n(primary key) column to determine conflicts. If there is no existing\nrow with the same `id`, `upsert()` inserts a new row, which\nwill fail in this case as there is already a row with `handle` `\"saoirse\"`.\nUsing the `onConflict` option, you can instruct `upsert()` to use\nanother column with a unique constraint to determine conflicts.", "data": { "sql": "```sql\ncreate table\n users (\n id int8 generated by default as identity primary key,\n handle text not null unique,\n display_name text\n );\n\ninsert into\n users (id, handle, display_name)\nvalues\n (1, 'saoirse', null);\n```" }, "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (handle)=(saoirse) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"users_handle_key\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.constructor": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "HEAD" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.abortSignal": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.abortSignal", "params": [ { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "comment": { "shortText": "The AbortSignal to use for the fetch request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set the AbortSignal for the fetch request.", "text": "You can use this to set a timeout for the request.", "examples": [ { "id": "aborting-requests-in-flight", "name": "Aborting requests in-flight", "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" }, { "id": "set-a-timeout", "name": "Set a timeout", "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.csv": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.csv", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a string in CSV format.", "examples": [ { "id": "return-data-as-csv", "name": "Return data as CSV", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.explain": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.explain", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "analyze", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" } }, { "name": "buffers", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on buffer usage" } }, { "name": "format", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "text" }, { "type": "literal", "value": "json" } ] }, "isOptional": true, "comment": { "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" } }, { "name": "settings", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on configuration\nparameters that affect query planning" } }, { "name": "verbose", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" } }, { "name": "wal", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on WAL record generation" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "PostgrestBuilder" }, { "type": "nameOnly", "name": "PostgrestBuilder" } ] } }, "comment": { "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", "examples": [ { "id": "get-the-execution-plan", "name": "Get the execution plan", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" }, { "id": "get-the-execution-plan-with-analyze-and-verbose", "name": "Get the execution plan with analyze and verbose", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.geojson": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.geojson", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." } }, "@supabase/postgrest-js.PostgrestTransformBuilder.limit": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.limit", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows to return" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by `rows`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\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');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.maxAffected": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.maxAffected", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows that can be affected" } } ], "comment": { "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." } }, "@supabase/postgrest-js.PostgrestTransformBuilder.maybeSingle": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.maybeSingle", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.order": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.order", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Order the query result by `column`.\n\nYou can call this method multiple times to order by multiple columns.\n\nYou can order referenced tables, but it only affects the ordering of the\nparent table if you use `!inner` in the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('id, name')\n .order('id', { ascending: false })\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\n const { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .order('name', { referencedTable: 'instruments', ascending: false })\n\n```", "description": "Ordering with `referencedTable` doesn't affect the ordering of the\nparent table.", "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, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n },\n {\n \"name\": \"harp\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": []\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "order-parent-table-by-a-referenced-table", "name": "Order parent table by a referenced table", "code": "```ts\n const { data, error } = await supabase\n .from('instruments')\n .select(`\n name,\n section:orchestral_sections (\n name\n )\n `)\n .order('section(name)', { ascending: true })\n\n```", "description": "Ordering with `referenced_table(col)` affects the ordering of the\nparent table.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"violin\",\n \"orchestral_sections\": {\"name\": \"strings\"}\n },\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/postgrest-js.PostgrestTransformBuilder.overrideTypes": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.range": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.range", "params": [ { "name": "from", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The starting index from which to limit the result" } }, { "name": "to", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The last index to which to limit the result" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.retry": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.returns": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`.", "text": "- Deprecated: use overrideTypes method instead", "examples": [ { "id": "override-type-of-successful-response", "name": "Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", "response": "```js\nlet x: typeof data // MyType[]\n```" }, { "id": "override-type-of-object-response", "name": "Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", "response": "```js\nlet x: typeof data // MyType | null\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.rollback": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.rollback", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", "examples": [ { "id": "validate-an-insert-without-persisting", "name": "Validate an insert without persisting", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.select": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", "examples": [ { "id": "with-upsert", "name": "With `upsert()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.setHeader": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestTransformBuilder.single": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.single", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.stripNulls": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.then": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/realtime-js.RealtimeChannel.constructor": { "name": "@supabase/realtime-js.RealtimeChannel.constructor", "params": [ { "name": "topic", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Topic name can be any string." } }, { "name": "params", "type": { "name": "RealtimeChannelOptions", "type": "object", "properties": [ { "name": "config", "type": { "type": "object", "properties": [ { "name": "broadcast", "type": { "type": "object", "properties": [ { "name": "ack", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "replay", "type": { "type": "nameOnly", "name": "ReplayOption" }, "isOptional": true }, { "name": "self", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" } }, { "name": "presence", "type": { "type": "object", "properties": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "key", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "key option is used to track presence payload across clients" } }, { "name": "private", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" } } ] } } ] } }, { "name": "socket", "type": { "type": "nameOnly", "name": "RealtimeClient" } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.\n\nThe topic determines which realtime stream you are subscribing to. Config options let you\nenable acknowledgement for broadcasts, presence tracking, or private channels.", "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 channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nconst channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)\n```" } ] } }, "@supabase/realtime-js.RealtimeChannel.copyBindings": { "name": "@supabase/realtime-js.RealtimeChannel.copyBindings", "params": [ { "name": "other", "type": { "type": "nameOnly", "name": "RealtimeChannel" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "@supabase/realtime-js.RealtimeChannel.httpSend": { "name": "@supabase/realtime-js.RealtimeChannel.httpSend", "params": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the broadcast event" } }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" }, "comment": { "shortText": "Payload to be sent (required)" } }, { "name": "opts", "type": { "type": "object", "properties": [ { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] }, "comment": { "shortText": "Options including timeout" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "success", "type": { "type": "literal", "value": true } } ] }, { "type": "object", "properties": [ { "name": "error", "type": { "type": "intrinsic", "name": "string" } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" } }, { "name": "success", "type": { "type": "literal", "value": false } } ] } ] } } }, "comment": { "shortText": "Sends a broadcast message explicitly via REST API.\n\nThis method always uses the REST API endpoint regardless of WebSocket connection state.\nUseful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.\n\nPayloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as\n`application/octet-stream`; all other payloads are JSON-encoded." } }, "@supabase/realtime-js.RealtimeChannel.on": { "name": "@supabase/realtime-js.RealtimeChannel.on", "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "sync" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates an event handler that listens to changes.", "text": "- By default, Broadcast and Presence are enabled for all projects.\n- By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](/docs/guides/api#realtime-api-overview).\n- You can receive the \"previous\" data for updates and deletes by setting the table's `REPLICA IDENTITY` to `FULL` (e.g., `ALTER TABLE your_table REPLICA IDENTITY FULL;`).\n- Row level security is not applied to delete statements. When RLS is enabled and replica identity is set to full, only the primary key is sent to clients.", "examples": [ { "id": "listen-to-broadcast-messages", "name": "Listen to broadcast messages", "code": "```js\nconst channel = supabase.channel(\"room1\")\n\nchannel.on(\"broadcast\", { event: \"cursor-pos\" }, (payload) => {\n console.log(\"Cursor position received!\", payload);\n}).subscribe((status) => {\n if (status === \"SUBSCRIBED\") {\n channel.send({\n type: \"broadcast\",\n event: \"cursor-pos\",\n payload: { x: Math.random(), y: Math.random() },\n });\n }\n});\n```" }, { "id": "listen-to-presence-sync", "name": "Listen to presence sync", "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'sync' }, () => {\n console.log('Synced presence state: ', channel.presenceState())\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n }\n })\n```" }, { "id": "listen-to-presence-join", "name": "Listen to presence join", "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'join' }, ({ newPresences }) => {\n console.log('Newly joined presences: ', newPresences)\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n }\n })\n```" }, { "id": "listen-to-presence-leave", "name": "Listen to presence leave", "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'leave' }, ({ leftPresences }) => {\n console.log('Newly left presences: ', leftPresences)\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n await channel.untrack()\n }\n })\n```" }, { "id": "listen-to-all-database-changes", "name": "Listen to all database changes", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: '*', schema: '*' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" }, { "id": "listen-to-a-specific-table", "name": "Listen to a specific table", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: '*', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" }, { "id": "listen-to-inserts", "name": "Listen to inserts", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" }, { "id": "listen-to-updates", "name": "Listen to updates", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```", "description": "By default, Supabase will send only the updated record. If you want to receive the previous values as well you can\nenable full replication for the table you are listening to:\n\n```sql\nalter table \"your_table\" replica identity full;\n```" }, { "id": "listen-to-deletes", "name": "Listen to deletes", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```", "description": "By default, Supabase does not send deleted records. If you want to receive the deleted record you can\nenable full replication for the table you are listening to:\n\n```sql\nalter table \"your_table\" replica identity full;\n```" }, { "id": "listen-to-multiple-events", "name": "Listen to multiple events", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, handleRecordInserted)\n .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, handleRecordDeleted)\n .subscribe()\n```", "description": "You can chain listeners if you want to listen to multiple events for each table." }, { "id": "listen-to-row-level-changes", "name": "Listen to row level changes", "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries', filter: 'id=eq.200' }, handleRecordUpdated)\n .subscribe()\n```", "description": "You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match." } ] }, "altSignatures": [ { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "join" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "name": "RealtimePresenceJoinPayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": { "type": "intrinsic", "name": "string" } }, { "name": "newPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "leave" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "name": "RealtimePresenceLeavePayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": { "type": "intrinsic", "name": "string" } }, { "name": "leftPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "subTypes": [ { "name": "RealtimePresenceJoinPayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": "[Circular]" }, { "name": "newPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] }, { "name": "RealtimePresenceLeavePayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": "[Circular]" }, { "name": "leftPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "name": "RealtimePostgresChangesPayload", "subTypes": [ { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" }, { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" }, { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "INSERT" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "UPDATE" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "DELETE" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "INSERT" }, { "type": "literal", "value": "UPDATE" }, { "type": "literal", "value": "DELETE" }, { "type": "literal", "value": "*" } ] }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "name": "RealtimePostgresChangesPayload", "subTypes": [ { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" }, { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" }, { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" }, "comment": { "shortText": "One of \"broadcast\", \"presence\", or \"postgres_changes\"." } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } } ] }, "comment": { "shortText": "Custom object specific to the Realtime feature detailing which payloads to receive." } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "meta", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "replayed", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Function to be invoked when event handler is triggered." } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "meta", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "replayed", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true }, { "name": "payload", "type": { "type": "nameOnly", "name": "T" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*", "name": "ALL" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastPayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "INSERT", "name": "INSERT" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastInsertPayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "UPDATE", "name": "UPDATE" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastUpdatePayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "DELETE", "name": "DELETE" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastDeletePayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "system" } }, { "name": "filter" }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } } ] }, "@supabase/realtime-js.RealtimeChannel.presenceState": { "name": "@supabase/realtime-js.RealtimeChannel.presenceState", "params": [], "ret": { "type": { "name": "RealtimePresenceState", "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } }, "comment": { "shortText": "Returns the current presence state for this channel.\n\nThe shape is a map keyed by presence key (for example a user id) where each entry contains the\ntracked metadata for that user." } }, "@supabase/realtime-js.RealtimeChannel.send": { "name": "@supabase/realtime-js.RealtimeChannel.send", "params": [ { "name": "args", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the event being sent" } }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true, "comment": { "shortText": "Payload to be sent" } }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "broadcast" }, { "type": "literal", "value": "presence" }, { "type": "literal", "value": "postgres_changes" } ] }, "comment": { "shortText": "The type of event to send" } } ] }, "comment": { "shortText": "Arguments to send to channel" } }, { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "comment": { "shortText": "Options to be used during the send process" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ { "type": "literal", "value": "ok" }, { "type": "literal", "value": "timed out" }, { "type": "literal", "value": "error" }, null ] } } }, "comment": { "shortText": "Sends a message into the channel.", "text": "- When using REST you don't need to subscribe to the channel\n- REST calls are only available from 2.37.0 onwards\n- If you create a channel only to send a REST broadcast, remove it from\n the client when the send completes", "examples": [ { "id": "send-a-message-via-websocket", "name": "Send a message via websocket", "code": "```js\nconst channel = supabase.channel('room1')\n\nchannel.subscribe((status) => {\n if (status === 'SUBSCRIBED') {\n channel.send({\n type: 'broadcast',\n event: 'cursor-pos',\n payload: { x: Math.random(), y: Math.random() },\n })\n }\n})\n```", "response": "```js\nok | timed out | error\n```" }, { "id": "send-a-message-via-rest", "name": "Send a message via REST", "code": "```js\nconst channel = supabase.channel('room1')\n\ntry {\n await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })\n} finally {\n await supabase.removeChannel(channel)\n}\n```" } ] } }, "@supabase/realtime-js.RealtimeChannel.subscribe": { "name": "@supabase/realtime-js.RealtimeChannel.subscribe", "params": [ { "name": "callback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "REALTIME_SUBSCRIBE_STATES" } }, { "name": "err", "type": { "type": "nameOnly", "name": "Error" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Subscribe registers your client with the server.\n\nThe optional `callback` receives a `status` and, on failure, an `err` argument.\nLog the full `err` so its `cause`, `name`, and any structured fields aren't hidden\nbehind `err.message`.", "examples": [ { "id": "handling-errors", "name": "Handling errors", "code": "```js\nsupabase.channel('room1').subscribe((status, err) => {\n if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {\n // Log the full error: its `cause` often holds the underlying reason.\n console.error(status, err)\n }\n})\n```" } ] } }, "@supabase/realtime-js.RealtimeChannel.teardown": { "name": "@supabase/realtime-js.RealtimeChannel.teardown", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Destroys and stops related timers." } }, "@supabase/realtime-js.RealtimeChannel.track": { "name": "@supabase/realtime-js.RealtimeChannel.track", "params": [ { "name": "payload", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } }, { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Sends the supplied payload to the presence tracker so other subscribers can see that this\nclient is online. Use `untrack` to stop broadcasting presence for the same key." } }, "@supabase/realtime-js.RealtimeChannel.unsubscribe": { "name": "@supabase/realtime-js.RealtimeChannel.unsubscribe", "params": [ { "name": "timeout", "type": { "type": "intrinsic", "name": "number" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Leaves the channel.\n\nUnsubscribes from server events, and instructs channel to terminate on server.\nTriggers onClose() hooks.\n\nTo receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:\nchannel.unsubscribe().receive(\"ok\", () => alert(\"left!\") )" } }, "@supabase/realtime-js.RealtimeChannel.untrack": { "name": "@supabase/realtime-js.RealtimeChannel.untrack", "params": [ { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Removes the current presence state for this client." } }, "@supabase/realtime-js.RealtimeChannel.updateJoinPayload": { "name": "@supabase/realtime-js.RealtimeChannel.updateJoinPayload", "params": [ { "name": "payload", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Updates the payload that will be sent the next time the channel joins (reconnects).\nUseful for rotating access tokens or updating config without re-creating the channel." } }, "@supabase/realtime-js.RealtimeClient.constructor": { "name": "@supabase/realtime-js.RealtimeClient.constructor", "params": [ { "name": "endPoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The string WebSocket endpoint, ie, \"ws://example.com/socket\", \"wss://example.com\", \"/socket\" (inherited host & protocol)" } }, { "name": "options", "type": { "name": "RealtimeClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "literal", "value": null } ] } } } }, "isOptional": true }, { "name": "decode", "type": { "type": "nameOnly", "name": "Decode" }, "isOptional": true }, { "name": "disconnectOnEmptyChannelsAfterMs", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "encode", "type": { "type": "nameOnly", "name": "Encode" }, "isOptional": true }, { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true }, { "name": "heartbeatCallback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "HeartbeatStatus" } }, { "name": "latency", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "heartbeatIntervalMs", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "log_level", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "logger", "type": { "type": "function", "params": [ { "name": "kind", "type": { "type": "intrinsic", "name": "string" } }, { "name": "msg", "type": { "type": "intrinsic", "name": "string" } }, { "name": "data", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "logLevel", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "params", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true }, { "name": "reconnectAfterMs", "type": { "type": "function", "params": [ { "name": "tries", "type": { "type": "intrinsic", "name": "number" } } ], "ret": { "type": { "type": "intrinsic", "name": "number" } } }, "isOptional": true }, { "name": "sessionStorage", "type": { "type": "nameOnly", "name": "Storage" }, "isOptional": true, "comment": { "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." } }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "transport", "type": { "type": "object", "name": "WebSocketLikeConstructor", "properties": [] }, "isOptional": true }, { "name": "vsn", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "worker", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "workerUrl", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeClient" } }, "comment": { "shortText": "Initializes the Socket.", "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 channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nclient.connect()\n```" } ] } }, "@supabase/realtime-js.RealtimeClient.channel": { "name": "@supabase/realtime-js.RealtimeClient.channel", "params": [ { "name": "topic", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "RealtimeChannelOptions", "type": "object", "properties": [ { "name": "config", "type": { "type": "object", "properties": [ { "name": "broadcast", "type": { "type": "object", "properties": [ { "name": "ack", "type": "[Circular]", "isOptional": true }, { "name": "replay", "type": { "type": "nameOnly", "name": "ReplayOption" }, "isOptional": true }, { "name": "self", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" } }, { "name": "presence", "type": { "type": "object", "properties": [ { "name": "enabled", "type": "[Circular]", "isOptional": true }, { "name": "key", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "key option is used to track presence payload across clients" } }, { "name": "private", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" } } ] } } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates (or reuses) a RealtimeChannel for the provided topic.\n\nTopics are automatically prefixed with `realtime:` to match the Realtime service.\nIf a channel with the same topic already exists it will be returned instead of creating\na duplicate connection." } }, "@supabase/realtime-js.RealtimeClient.connect": { "name": "@supabase/realtime-js.RealtimeClient.connect", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Connects the socket, unless already connected." } }, "@supabase/realtime-js.RealtimeClient.connectionState": { "name": "@supabase/realtime-js.RealtimeClient.connectionState", "params": [], "ret": { "type": { "type": "nameOnly", "name": "ConnectionState" } }, "comment": { "shortText": "Returns the current state of the socket." } }, "@supabase/realtime-js.RealtimeClient.disconnect": { "name": "@supabase/realtime-js.RealtimeClient.disconnect", "params": [ { "name": "code", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "A numeric status code to send on disconnect." } }, { "name": "reason", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A custom reason for the disconnect." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "literal", "value": "ok" }, { "type": "literal", "value": "timeout" } ] } } }, "comment": { "shortText": "Disconnects the socket." } }, "@supabase/realtime-js.RealtimeClient.endpointURL": { "name": "@supabase/realtime-js.RealtimeClient.endpointURL", "params": [], "ret": { "type": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Returns the URL of the websocket." } }, "@supabase/realtime-js.RealtimeClient.getChannels": { "name": "@supabase/realtime-js.RealtimeClient.getChannels", "params": [], "ret": { "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "RealtimeChannel" } } }, "comment": { "shortText": "Returns all created channels" } }, "@supabase/realtime-js.RealtimeClient.isConnected": { "name": "@supabase/realtime-js.RealtimeClient.isConnected", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` is the connection is open." } }, "@supabase/realtime-js.RealtimeClient.isConnecting": { "name": "@supabase/realtime-js.RealtimeClient.isConnecting", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` if the connection is currently connecting." } }, "@supabase/realtime-js.RealtimeClient.isDisconnecting": { "name": "@supabase/realtime-js.RealtimeClient.isDisconnecting", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` if the connection is currently disconnecting." } }, "@supabase/realtime-js.RealtimeClient.log": { "name": "@supabase/realtime-js.RealtimeClient.log", "params": [ { "name": "kind", "type": { "type": "intrinsic", "name": "string" } }, { "name": "msg", "type": { "type": "intrinsic", "name": "string" } }, { "name": "data", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Logs the message.\n\nFor customized logging, `this.logger` can be overridden in Client constructor." } }, "@supabase/realtime-js.RealtimeClient.onHeartbeat": { "name": "@supabase/realtime-js.RealtimeClient.onHeartbeat", "params": [ { "name": "callback", "type": { "type": "nameOnly", "name": "HeartbeatCallback" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Sets a callback that receives lifecycle events for internal heartbeat messages.\nUseful for instrumenting connection health (e.g. sent/ok/timeout/disconnected)." } }, "@supabase/realtime-js.RealtimeClient.push": { "name": "@supabase/realtime-js.RealtimeClient.push", "params": [ { "name": "data", "type": { "name": "RealtimeMessage", "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "join_ref", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ref", "type": { "type": "intrinsic", "name": "string" } }, { "name": "topic", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Push out a message if the socket is connected.\n\nIf the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established." } }, "@supabase/realtime-js.RealtimeClient.removeAllChannels": { "name": "@supabase/realtime-js.RealtimeClient.removeAllChannels", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "array", "elemType": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ { "type": "literal", "value": "ok" }, { "type": "literal", "value": "timed out" }, { "type": "literal", "value": "error" }, null ] } } } }, "comment": { "shortText": "Unsubscribes, removes and tears down all channels" } }, "@supabase/realtime-js.RealtimeClient.removeChannel": { "name": "@supabase/realtime-js.RealtimeClient.removeChannel", "params": [ { "name": "channel", "type": { "type": "nameOnly", "name": "RealtimeChannel" }, "comment": { "shortText": "A RealtimeChannel instance" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Unsubscribes, removes and tears down a single channel" } }, "@supabase/realtime-js.RealtimeClient.sendHeartbeat": { "name": "@supabase/realtime-js.RealtimeClient.sendHeartbeat", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Sends a heartbeat message if the socket is connected." } }, "@supabase/realtime-js.RealtimeClient.setAuth": { "name": "@supabase/realtime-js.RealtimeClient.setAuth", "params": [ { "name": "token", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "comment": { "shortText": "A JWT string to override the token set on the client." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Sets the JWT access token used for channel subscription authorization and Realtime RLS.\n\nIf param is null it will use the `accessToken` callback function or the token set on the client.\n\nOn callback used, it will set the value of the token internal to the client.\n\nWhen a token is explicitly provided, it will be preserved across channel operations\n(including removeChannel and resubscribe). The `accessToken` callback will not be\ninvoked until `setAuth()` is called without arguments.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nSetting the authorization header\n// Use a manual token (preserved across resubscribes, ignores accessToken callback)\nclient.realtime.setAuth('my-custom-jwt')\n\n// Switch back to using the accessToken callback\nclient.realtime.setAuth()\n```" } ] } }, "@supabase/realtime-js.RealtimePresence.constructor": { "name": "@supabase/realtime-js.RealtimePresence.constructor", "params": [ { "name": "channel", "type": { "type": "nameOnly", "name": "RealtimeChannel" }, "comment": { "shortText": "The realtime channel to bind to." } }, { "name": "opts", "type": { "type": "nameOnly", "name": "RealtimePresenceOptions" }, "isOptional": true, "comment": { "shortText": "Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`." } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimePresence" } }, "comment": { "shortText": "Creates a Presence helper that keeps the local presence state in sync with the server.", "examples": [ { "id": "example-for-a-presence-channel", "name": "Example for a presence channel", "code": "```ts\nconst presence = new RealtimePresence(channel)\n\nchannel.on('presence', ({ event, key }) => {\n console.log(`Presence ${event} on ${key}`)\n})\n```" } ] } }, "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor": { "name": "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor", "params": [], "ret": { "type": { "type": "function", "params": [ { "name": "url", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "URL" } ] } }, { "name": "protocols", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "WebSocket" } } } }, "comment": { "shortText": "Returns the best available WebSocket constructor for the current runtime.", "examples": [ { "id": "example-with-error-handling", "name": "Example with error handling", "code": "```ts\ntry {\n const WS = WebSocketFactory.getWebSocketConstructor()\n const socket = new WS('wss://example.com/socket')\n} catch (error) {\n console.error('WebSocket not available in this environment.', error)\n}\n```" } ] } }, "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported": { "name": "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Detects whether the runtime can establish WebSocket connections.", "examples": [ { "id": "example-in-a-node-js-script", "name": "Example in a Node.js script", "code": "```ts\nif (!WebSocketFactory.isWebSocketSupported()) {\n console.error('WebSockets are required for this script.')\n process.exitCode = 1\n}\n```" } ] } }, "@supabase/realtime-js.WebSocketLike.addEventListener": { "name": "@supabase/realtime-js.WebSocketLike.addEventListener", "params": [ { "name": "type", "type": { "type": "intrinsic", "name": "string" } }, { "name": "listener", "type": { "type": "nameOnly", "name": "EventListener" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Registers an event listener on the socket (compatible with browser WebSocket API)." } }, "@supabase/realtime-js.WebSocketLike.close": { "name": "@supabase/realtime-js.WebSocketLike.close", "params": [ { "name": "code", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "reason", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Closes the socket, optionally providing a close code and reason." } }, "@supabase/realtime-js.WebSocketLike.removeEventListener": { "name": "@supabase/realtime-js.WebSocketLike.removeEventListener", "params": [ { "name": "type", "type": { "type": "intrinsic", "name": "string" } }, { "name": "listener", "type": { "type": "nameOnly", "name": "EventListener" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Removes a previously registered event listener." } }, "@supabase/realtime-js.WebSocketLike.send": { "name": "@supabase/realtime-js.WebSocketLike.send", "params": [ { "name": "data", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "ArrayBufferLike" }, { "type": "nameOnly", "name": "Blob" }, { "type": "nameOnly", "name": "ArrayBufferView" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Sends data through the socket using the underlying implementation." } }, "@supabase/realtime-js.WebSocketLikeConstructor.constructor": { "name": "@supabase/realtime-js.WebSocketLikeConstructor.constructor", "params": [ { "name": "address", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "URL" } ] } }, { "name": "subprotocols", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "object", "name": "WebSocketLike", "properties": [ { "name": "binaryType", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "bufferedAmount", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "CLOSED", "type": { "type": "intrinsic", "name": "number" } }, { "name": "CLOSING", "type": { "type": "intrinsic", "name": "number" } }, { "name": "CONNECTING", "type": { "type": "intrinsic", "name": "number" } }, { "name": "dispatchEvent", "type": { "type": "function", "params": [ { "name": "event", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "boolean" } } }, "isOptional": true }, { "name": "extensions", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "onclose", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "CloseEvent" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onerror", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onmessage", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "MessageEvent" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onopen", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "OPEN", "type": { "type": "intrinsic", "name": "number" } }, { "name": "protocol", "type": { "type": "intrinsic", "name": "string" } }, { "name": "readyState", "type": { "type": "intrinsic", "name": "number" } }, { "name": "url", "type": { "type": "intrinsic", "name": "string" } } ] } } }, "@supabase/storage-js.StorageApiError.constructor": { "name": "@supabase/storage-js.StorageApiError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" } }, { "name": "statusCode", "type": { "type": "intrinsic", "name": "string" } }, { "name": "namespace", "type": { "type": "union", "name": "ErrorNamespace", "subTypes": [ { "type": "literal", "value": "storage" }, { "type": "literal", "value": "vectors" } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageApiError" } } }, "@supabase/storage-js.StorageApiError.toJSON": { "name": "@supabase/storage-js.StorageApiError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.StorageClient.constructor": { "name": "@supabase/storage-js.StorageClient.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } } }, { "name": "fetch", "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": "opts", "type": { "type": "object", "name": "StorageClientOptions", "properties": [ { "name": "useNewHostname", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "StorageClient" } }, "comment": { "shortText": "Creates a client for Storage buckets, files, analytics, and vectors.", "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 avatars = supabase.storage.from('avatars')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { StorageClient } from '@supabase/storage-js'\n\nconst storage = new StorageClient('https://xyzcompany.supabase.co/storage/v1', {\n apikey: 'your-publishable-key',\n})\nconst avatars = storage.from('avatars')\n```" } ] } }, "@supabase/storage-js.StorageClient.createBucket": { "name": "@supabase/storage-js.StorageClient.createBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "A unique identifier for the bucket you are creating." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true, "comment": { "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." } }, { "name": "fileSizeLimit", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "number" } ] }, "isOptional": true, "comment": { "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." } }, { "name": "public", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private." } }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ { "type": "literal", "value": "STANDARD" }, { "type": "literal", "value": "ANALYTICS" }, null ] }, "isOptional": true, "comment": { "shortText": "(private-beta) specifies the bucket type. see `BucketType` for more details.\n - default bucket type is `STANDARD`" } } ] } } ], "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": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates a new Storage bucket", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `insert`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "create-bucket", "name": "Create bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .createBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", "response": "```json\n{\n \"data\": {\n \"name\": \"avatars\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.StorageClient.deleteBucket": { "name": "@supabase/storage-js.StorageClient.deleteBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to delete." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.\nYou must first `empty()` the bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `delete`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "delete-bucket", "name": "Delete bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .deleteBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.StorageClient.emptyBucket": { "name": "@supabase/storage-js.StorageClient.emptyBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to empty." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Removes all objects inside a single bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: `select` and `delete`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "empty-bucket", "name": "Empty bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .emptyBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully emptied\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.StorageClient.from": { "name": "@supabase/storage-js.StorageClient.from", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The bucket id to operate on." } } ], "ret": { "type": { "type": "nameOnly", "name": "default" } }, "comment": { "shortText": "Perform file operation in a bucket.", "examples": [ { "id": "accessing-a-bucket", "name": "Accessing a bucket", "code": "```typescript\nconst avatars = supabase.storage.from('avatars')\n```" } ] } }, "@supabase/storage-js.StorageClient.getBucket": { "name": "@supabase/storage-js.StorageClient.getBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to retrieve." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true }, { "name": "created_at", "type": { "type": "intrinsic", "name": "string" } }, { "name": "file_size_limit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" } }, { "name": "owner", "type": { "type": "intrinsic", "name": "string" } }, { "name": "public", "type": { "type": "intrinsic", "name": "boolean" } }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of an existing Storage bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "get-bucket", "name": "Get bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .getBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"id\": \"avatars\",\n \"name\": \"avatars\",\n \"owner\": \"\",\n \"public\": false,\n \"file_size_limit\": 1024,\n \"allowed_mime_types\": [\n \"image/png\"\n ],\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.StorageClient.listBuckets": { "name": "@supabase/storage-js.StorageClient.listBuckets", "params": [ { "name": "options", "type": { "type": "object", "name": "ListBucketOptions", "properties": [ { "name": "limit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "offset", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "search", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "sortColumn", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "id" }, { "type": "literal", "value": "name" }, { "type": "literal", "value": "created_at" }, { "type": "literal", "value": "updated_at" } ] }, "isOptional": true }, { "name": "sortOrder", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "asc" }, { "type": "literal", "value": "desc" } ] }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Query parameters for listing buckets" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true }, { "name": "created_at", "type": "[Circular]" }, { "name": "file_size_limit", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "name", "type": "[Circular]" }, { "name": "owner", "type": "[Circular]" }, { "name": "public", "type": "[Circular]" }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "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": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of all Storage buckets within an existing project.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "list-buckets", "name": "List buckets", "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets()\n```" }, { "id": "list-buckets-with-options", "name": "List buckets with options", "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc',\n search: 'prod'\n })\n```" } ] } }, "@supabase/storage-js.StorageClient.setHeader": { "name": "@supabase/storage-js.StorageClient.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." } }, "@supabase/storage-js.StorageClient.throwOnError": { "name": "@supabase/storage-js.StorageClient.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." } }, "@supabase/storage-js.StorageClient.updateBucket": { "name": "@supabase/storage-js.StorageClient.updateBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "A unique identifier for the bucket you are updating." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true, "comment": { "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." } }, { "name": "fileSizeLimit", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "number" } ] }, "isOptional": true, "comment": { "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." } }, { "name": "public", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Updates a Storage bucket", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `update`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "update-bucket", "name": "Update bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .updateBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully updated\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.StorageError.constructor": { "name": "@supabase/storage-js.StorageError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "namespace", "type": { "type": "union", "name": "ErrorNamespace", "subTypes": [ "[Circular]", "[Circular]" ] } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "statusCode", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "StorageError" } } }, "@supabase/storage-js.StorageError.toJSON": { "name": "@supabase/storage-js.StorageError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.StorageUnknownError.constructor": { "name": "@supabase/storage-js.StorageUnknownError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "originalError", "type": { "type": "intrinsic", "name": "unknown" } }, { "name": "namespace", "type": { "type": "union", "name": "ErrorNamespace", "subTypes": [ "[Circular]", "[Circular]" ] } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageUnknownError" } } }, "@supabase/storage-js.StorageUnknownError.toJSON": { "name": "@supabase/storage-js.StorageUnknownError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.StorageVectorsApiError.constructor": { "name": "@supabase/storage-js.StorageVectorsApiError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" } }, { "name": "statusCode", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageVectorsApiError" } } }, "@supabase/storage-js.StorageVectorsApiError.toJSON": { "name": "@supabase/storage-js.StorageVectorsApiError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.StorageVectorsError.constructor": { "name": "@supabase/storage-js.StorageVectorsError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageVectorsError" } } }, "@supabase/storage-js.StorageVectorsError.toJSON": { "name": "@supabase/storage-js.StorageVectorsError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.StorageVectorsUnknownError.constructor": { "name": "@supabase/storage-js.StorageVectorsUnknownError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "originalError", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageVectorsUnknownError" } } }, "@supabase/storage-js.StorageVectorsUnknownError.toJSON": { "name": "@supabase/storage-js.StorageVectorsUnknownError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/storage-js.isStorageError": { "name": "@supabase/storage-js.isStorageError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" }, "comment": { "shortText": "The error to check" } } ], "comment": { "shortText": "Type guard to check if an error is a StorageError" } }, "@supabase/storage-js.isStorageVectorsError": { "name": "@supabase/storage-js.isStorageVectorsError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" }, "comment": { "shortText": "The error to check" } } ], "comment": { "shortText": "Type guard to check if an error is a StorageVectorsError" } }, "@supabase/storage-js.packages/BlobDownloadBuilder.default.constructor": { "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.constructor", "params": [ { "name": "downloadFn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "Response" } } } } }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" } } ], "ret": { "type": { "type": "nameOnly", "name": "default" } } }, "@supabase/storage-js.packages/BlobDownloadBuilder.default.asStream": { "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.asStream", "params": [], "ret": { "type": { "type": "nameOnly", "name": "default" } } }, "@supabase/storage-js.packages/BlobDownloadBuilder.default.catch": { "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.catch", "params": [ { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "Blob" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] }, { "type": "nameOnly", "name": "TResult" } ] } } }, "comment": { "shortText": "Attaches a callback for only the rejection of the Promise." } }, "@supabase/storage-js.packages/BlobDownloadBuilder.default.finally": { "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.finally", "params": [ { "name": "onfinally", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is settled (fulfilled or rejected)." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "Blob" } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\nresolved value cannot be modified from the callback." } }, "@supabase/storage-js.packages/BlobDownloadBuilder.default.then": { "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value", "type": { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "Blob" } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "TResult2" } ] } } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.constructor": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The base URL for the storage API" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "HTTP headers to include in requests" } }, { "name": "fetch", "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, "comment": { "shortText": "Optional custom fetch implementation" } } ], "ret": { "type": { "type": "nameOnly", "name": "default" } }, "comment": { "shortText": "Creates a new StorageAnalyticsClient instance\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "using-supabase-js-recommended", "name": "Using supabase-js (recommended)", "code": "```typescript\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.storage.analytics.listBuckets()\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```typescript\nimport { StorageAnalyticsClient } from '@supabase/storage-js'\n\nconst client = new StorageAnalyticsClient(url, headers)\n```" } ] } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "A unique name for the bucket you are creating" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "name": "AnalyticBucket", "properties": [ { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ISO 8601 timestamp of bucket creation" } }, { "name": "format", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Storage format used (e.g., 'iceberg')" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the bucket" } }, { "name": "type", "type": { "type": "literal", "value": "ANALYTICS" }, "comment": { "shortText": "Bucket type - always 'ANALYTICS' for analytics buckets" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ISO 8601 timestamp of last update" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates a new analytics bucket using Iceberg tables\nAnalytics buckets are optimized for analytical queries and data processing\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "text": "- Creates a new analytics bucket using Iceberg tables\n- Analytics buckets are optimized for analytical queries and data processing", "examples": [ { "id": "create-analytics-bucket", "name": "Create analytics bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .createBucket('analytics-data')\n```", "response": "```json\n{\n \"data\": {\n \"name\": \"analytics-data\",\n \"type\": \"ANALYTICS\",\n \"format\": \"iceberg\",\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket", "params": [ { "name": "bucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to delete" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Deletes an existing analytics bucket\nA bucket can't be deleted with existing objects inside it\nYou must first empty the bucket before deletion\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "text": "- Deletes an analytics bucket", "examples": [ { "id": "delete-analytics-bucket", "name": "Delete analytics bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .deleteBucket('analytics-data')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.from": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from", "params": [ { "name": "bucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the analytics bucket (warehouse) to connect to" } } ], "ret": { "type": { "type": "nameOnly", "name": "WrappedIcebergRestCatalog" } }, "comment": { "shortText": "Get an Iceberg REST Catalog client configured for a specific analytics bucket\nUse this to perform advanced table and namespace operations within the bucket\nThe returned client provides full access to the Apache Iceberg REST Catalog API\nwith the Supabase `{ data, error }` pattern for consistent error handling on all operations.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "text": "This method provides a bridge between Supabase's bucket management and the standard\nApache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.\nAll authentication and configuration is handled automatically using your Supabase credentials.\n\n**Error Handling**: Invalid bucket names throw immediately. All catalog\noperations return `{ data, error }` where errors are `IcebergError` instances from iceberg-js.\nUse helper methods like `error.isNotFound()` or check `error.status` for specific error handling.\nUse `.throwOnError()` on the analytics client if you prefer exceptions for catalog operations.\n\n**Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently\ndeletes all table data. Without it, the table is marked as deleted but data remains.\n\n**Library Dependency**: The returned catalog wraps `IcebergRestCatalog` from iceberg-js.\nFor complete API documentation and advanced usage, refer to the\n[iceberg-js documentation](https://supabase.github.io/iceberg-js/).", "examples": [ { "id": "get-catalog-and-create-table", "name": "Get catalog and create table", "code": "```js\n// First, create an analytics bucket\nconst { data: bucket, error: bucketError } = await supabase\n .storage\n .analytics\n .createBucket('analytics-data')\n\n// Get the Iceberg catalog for that bucket\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// Create a namespace\nconst { error: nsError } = await catalog.createNamespace({ namespace: ['default'] })\n\n// Create a table with schema\nconst { data: tableMetadata, error: tableError } = await catalog.createTable(\n { namespace: ['default'] },\n {\n name: 'events',\n schema: {\n type: 'struct',\n fields: [\n { id: 1, name: 'id', type: 'long', required: true },\n { id: 2, name: 'timestamp', type: 'timestamp', required: true },\n { id: 3, name: 'user_id', type: 'string', required: false }\n ],\n 'schema-id': 0,\n 'identifier-field-ids': [1]\n },\n 'partition-spec': {\n 'spec-id': 0,\n fields: []\n },\n 'write-order': {\n 'order-id': 0,\n fields: []\n },\n properties: {\n 'write.format.default': 'parquet'\n }\n }\n)\n```" }, { "id": "list-tables-in-namespace", "name": "List tables in namespace", "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// List all tables in the default namespace\nconst { data: tables, error: listError } = await catalog.listTables({ namespace: ['default'] })\nif (listError) {\n if (listError.isNotFound()) {\n console.log('Namespace not found')\n }\n return\n}\nconsole.log(tables) // [{ namespace: ['default'], name: 'events' }]\n```" }, { "id": "working-with-namespaces", "name": "Working with namespaces", "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// List all namespaces\nconst { data: namespaces } = await catalog.listNamespaces()\n\n// Create namespace with properties\nawait catalog.createNamespace(\n { namespace: ['production'] },\n { properties: { owner: 'data-team', env: 'prod' } }\n)\n```" }, { "id": "cleanup-operations", "name": "Cleanup operations", "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// Drop table with purge option (removes all data)\nconst { error: dropError } = await catalog.dropTable(\n { namespace: ['default'], name: 'events' },\n { purge: true }\n)\n\nif (dropError?.isNotFound()) {\n console.log('Table does not exist')\n}\n\n// Drop namespace (must be empty)\nawait catalog.dropNamespace({ namespace: ['default'] })\n```" } ] } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "limit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum number of buckets to return" } }, { "name": "offset", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Number of buckets to skip" } }, { "name": "search", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Search term to filter bucket names" } }, { "name": "sortColumn", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "name" }, { "type": "literal", "value": "created_at" }, { "type": "literal", "value": "updated_at" } ] }, "isOptional": true, "comment": { "shortText": "Column to sort by ('name', 'created_at', 'updated_at')" } }, { "name": "sortOrder", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "asc" }, { "type": "literal", "value": "desc" } ] }, "isOptional": true, "comment": { "shortText": "Sort order ('asc' or 'desc')" } } ] }, "isOptional": true, "comment": { "shortText": "Query parameters for listing buckets" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "name": "AnalyticBucket", "properties": [ { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "ISO 8601 timestamp of bucket creation" } }, { "name": "format", "type": "[Circular]", "comment": { "shortText": "Storage format used (e.g., 'iceberg')" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the bucket" } }, { "name": "type", "type": "[Circular]", "comment": { "shortText": "Bucket type - always 'ANALYTICS' for analytics buckets" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "ISO 8601 timestamp of last update" } } ] } } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of all Analytics Storage buckets within an existing project\nOnly returns buckets of type 'ANALYTICS'\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "text": "- Retrieves the details of all Analytics Storage buckets within an existing project\n- Only returns buckets of type 'ANALYTICS'", "examples": [ { "id": "list-analytics-buckets", "name": "List analytics buckets", "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc'\n })\n```", "response": "```json\n{\n \"data\": [\n {\n \"name\": \"analytics-data\",\n \"type\": \"ANALYTICS\",\n \"format\": \"iceberg\",\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n }\n ],\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.setHeader": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." } }, "@supabase/storage-js.packages/StorageAnalyticsClient.default.throwOnError": { "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." } }, "@supabase/storage-js.packages/StorageBucketApi.default.constructor": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } } }, { "name": "fetch", "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": "opts", "type": { "type": "object", "name": "StorageClientOptions", "properties": [ { "name": "useNewHostname", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "default" } } }, "@supabase/storage-js.packages/StorageBucketApi.default.createBucket": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.createBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "A unique identifier for the bucket you are creating." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true, "comment": { "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." } }, { "name": "fileSizeLimit", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "number" } ] }, "isOptional": true, "comment": { "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." } }, { "name": "public", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private." } }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true, "comment": { "shortText": "(private-beta) specifies the bucket type. see `BucketType` for more details.\n - default bucket type is `STANDARD`" } } ] } } ], "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": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates a new Storage bucket", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `insert`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "create-bucket", "name": "Create bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .createBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", "response": "```json\n{\n \"data\": {\n \"name\": \"avatars\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to delete." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.\nYou must first `empty()` the bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `delete`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "delete-bucket", "name": "Delete bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .deleteBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to empty." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Removes all objects inside a single bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: `select` and `delete`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "empty-bucket", "name": "Empty bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .emptyBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully emptied\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageBucketApi.default.getBucket": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.getBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique identifier of the bucket you would like to retrieve." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true }, { "name": "created_at", "type": "[Circular]" }, { "name": "file_size_limit", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "name", "type": "[Circular]" }, { "name": "owner", "type": "[Circular]" }, { "name": "public", "type": "[Circular]" }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "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": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of an existing Storage bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "get-bucket", "name": "Get bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .getBucket('avatars')\n```", "response": "```json\n{\n \"data\": {\n \"id\": \"avatars\",\n \"name\": \"avatars\",\n \"owner\": \"\",\n \"public\": false,\n \"file_size_limit\": 1024,\n \"allowed_mime_types\": [\n \"image/png\"\n ],\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageBucketApi.default.listBuckets": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.listBuckets", "params": [ { "name": "options", "type": { "type": "object", "name": "ListBucketOptions", "properties": [ { "name": "limit", "type": "[Circular]", "isOptional": true }, { "name": "offset", "type": "[Circular]", "isOptional": true }, { "name": "search", "type": "[Circular]", "isOptional": true }, { "name": "sortColumn", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true }, { "name": "sortOrder", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Query parameters for listing buckets" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true }, { "name": "created_at", "type": "[Circular]" }, { "name": "file_size_limit", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "name", "type": "[Circular]" }, { "name": "owner", "type": "[Circular]" }, { "name": "public", "type": "[Circular]" }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "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": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of all Storage buckets within an existing project.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "list-buckets", "name": "List buckets", "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets()\n```" }, { "id": "list-buckets-with-options", "name": "List buckets with options", "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc',\n search: 'prod'\n })\n```" } ] } }, "@supabase/storage-js.packages/StorageBucketApi.default.setHeader": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." } }, "@supabase/storage-js.packages/StorageBucketApi.default.throwOnError": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." } }, "@supabase/storage-js.packages/StorageBucketApi.default.updateBucket": { "name": "@supabase/storage-js.packages/StorageBucketApi.default.updateBucket", "params": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "A unique identifier for the bucket you are updating." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true, "comment": { "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." } }, { "name": "fileSizeLimit", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "number" } ] }, "isOptional": true, "comment": { "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." } }, { "name": "public", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Updates a Storage bucket", "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `update`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "update-bucket", "name": "Update bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .updateBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully updated\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.constructor": { "name": "@supabase/storage-js.packages/StorageFileApi.default.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } } }, { "name": "bucketId", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "fetch", "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 } ], "ret": { "type": { "type": "nameOnly", "name": "default" } } }, "@supabase/storage-js.packages/StorageFileApi.default.copy": { "name": "@supabase/storage-js.packages/StorageFileApi.default.copy", "params": [ { "name": "fromPath", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The original file path, including the current file name. For example `folder/image.png`." } }, { "name": "toPath", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The new file path, including the new file name. For example `folder/image-copy.png`." } }, { "name": "options", "type": { "type": "object", "name": "DestinationOptions", "properties": [ { "name": "destinationBucket", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "The destination options." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Copies an existing file to a new path in the same bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `insert` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "copy-file", "name": "Copy file", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .copy('public/avatar1.png', 'private/avatar2.png')\n```", "response": "```json\n{\n \"data\": {\n \"path\": \"avatars/private/avatar2.png\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl": { "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the current file name. For example `folder/image.png`." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "upsert", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "If set to true, allows the file to be overwritten if it already exists." } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" } }, { "name": "signedUrl", "type": { "type": "intrinsic", "name": "string" } }, { "name": "token", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates a signed upload URL.\nSigned upload URLs can be used to upload files to the bucket without further authentication.\nThey are valid for 2 hours.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `insert`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "create-signed-upload-url", "name": "Create Signed Upload URL", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUploadUrl('folder/cat.jpg')\n```", "response": "```json\n{\n \"data\": {\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/upload/sign/avatars/folder/cat.jpg?token=\",\n \"path\": \"folder/cat.jpg\",\n \"token\": \"\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl": { "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the current file name. For example `folder/image.png`." } }, { "name": "expiresIn", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "cacheNonce", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." } }, { "name": "download", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "boolean" } ] }, "isOptional": true, "comment": { "shortText": "triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." } }, { "name": "transform", "type": { "type": "object", "name": "TransformOptions", "properties": [ { "name": "format", "type": { "type": "literal", "value": "origin" }, "isOptional": true, "comment": { "shortText": "Specify the format of the image requested.\n\nWhen using 'origin' we force the format to be the same as the original image.\nWhen this option is not passed in, images are optimized to modern image formats like Webp." } }, { "name": "height", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "The height of the image in pixels." } }, { "name": "quality", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Set the quality of the returned image.\nA number from 20 to 100, with 100 being the highest quality.\nDefaults to 80" } }, { "name": "resize", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "cover" }, { "type": "literal", "value": "contain" }, { "type": "literal", "value": "fill" } ] }, "isOptional": true, "comment": { "shortText": "The resize mode can be cover, contain or fill. Defaults to cover.\nCover resizes the image to maintain it's aspect ratio while filling the entire width and height.\nContain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.\nFill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit." } }, { "name": "width", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "The width of the image in pixels." } } ] }, "isOptional": true, "comment": { "shortText": "Transform the asset before serving it to the client." } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "signedUrl", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "create-signed-url", "name": "Create Signed URL", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60)\n```", "response": "```json\n{\n \"data\": {\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=\"\n },\n \"error\": null\n}\n```" }, { "id": "create-a-signed-url-for-an-asset-with-transformations", "name": "Create a signed URL for an asset with transformations", "code": "```js\nconst { data } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60, {\n transform: {\n width: 100,\n height: 100,\n }\n })\n```" }, { "id": "create-a-signed-url-which-triggers-the-download-of-the-asset", "name": "Create a signed URL which triggers the download of the asset", "code": "```js\nconst { data } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60, {\n download: true,\n })\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls": { "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls", "params": [ { "name": "paths", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`." } }, { "name": "expiresIn", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "cacheNonce", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." } }, { "name": "download", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "boolean" } ] }, "isOptional": true, "comment": { "shortText": "triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "properties": [ { "name": "error", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] } }, { "name": "path", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] } }, { "name": "signedUrl", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Creates multiple signed URLs. Use a signed URL to share a file for a fixed amount of time.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "create-signed-urls", "name": "Create Signed URLs", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)\n```", "response": "```json\n{\n \"data\": [\n {\n \"error\": null,\n \"path\": \"folder/avatar1.png\",\n \"signedURL\": \"/object/sign/avatars/folder/avatar1.png?token=\",\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=\"\n },\n {\n \"error\": null,\n \"path\": \"folder/avatar2.png\",\n \"signedURL\": \"/object/sign/avatars/folder/avatar2.png?token=\",\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar2.png?token=\"\n }\n ],\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.download": { "name": "@supabase/storage-js.packages/StorageFileApi.default.download", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The full path and file name of the file to be downloaded. For example `folder/image.png`." } }, { "name": "options", "type": { "type": "nameOnly", "name": "Options" }, "isOptional": true }, { "name": "parameters", "type": { "type": "object", "name": "FetchParameters", "properties": [ { "name": "cache", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "default" }, { "type": "literal", "value": "no-store" }, { "type": "literal", "value": "reload" }, { "type": "literal", "value": "no-cache" }, { "type": "literal", "value": "force-cache" }, { "type": "literal", "value": "only-if-cached" } ] }, "isOptional": true, "comment": { "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" } }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true, "comment": { "shortText": "Pass in an AbortController's signal to cancel the request." } } ] }, "isOptional": true, "comment": { "shortText": "Additional fetch parameters like signal for cancellation. Supports standard fetch options including cache control." } } ], "ret": { "type": { "type": "nameOnly", "name": "default" } }, "comment": { "shortText": "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "download-file", "name": "Download file", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png')\n```", "response": "```json\n{\n \"data\": ,\n \"error\": null\n}\n```" }, { "id": "download-file-with-transformations", "name": "Download file with transformations", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {\n transform: {\n width: 100,\n height: 100,\n quality: 80\n }\n })\n```" }, { "id": "download-with-cache-control-useful-in-edge-functions", "name": "Download with cache control (useful in Edge Functions)", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {}, { cache: 'no-store' })\n```" }, { "id": "download-with-abort-signal", "name": "Download with abort signal", "code": "```js\nconst controller = new AbortController()\nsetTimeout(() => controller.abort(), 5000)\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {}, { signal: controller.signal })\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.exists": { "name": "@supabase/storage-js.packages/StorageFileApi.default.exists", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the file name. For example `folder/image.png`." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "boolean" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "boolean" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Checks the existence of a file.", "examples": [ { "id": "check-file-existence", "name": "Check file existence", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .exists('folder/avatar1.png')\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl": { "name": "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The path and name of the file to generate the public URL for. For example `folder/image.png`." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "cacheNonce", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." } }, { "name": "download", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "intrinsic", "name": "boolean" } ] }, "isOptional": true, "comment": { "shortText": "Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." } }, { "name": "transform", "type": { "type": "object", "name": "TransformOptions", "properties": [ { "name": "format", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Specify the format of the image requested.\n\nWhen using 'origin' we force the format to be the same as the original image.\nWhen this option is not passed in, images are optimized to modern image formats like Webp." } }, { "name": "height", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The height of the image in pixels." } }, { "name": "quality", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Set the quality of the returned image.\nA number from 20 to 100, with 100 being the highest quality.\nDefaults to 80" } }, { "name": "resize", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "The resize mode can be cover, contain or fill. Defaults to cover.\nCover resizes the image to maintain it's aspect ratio while filling the entire width and height.\nContain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.\nFill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit." } }, { "name": "width", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The width of the image in pixels." } } ] }, "isOptional": true, "comment": { "shortText": "Transform the asset before serving it to the client." } } ] }, "isOptional": true } ], "ret": { "type": { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "publicUrl", "type": { "type": "intrinsic", "name": "string" } } ] } } ] } }, "comment": { "shortText": "A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.\nThis function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.", "text": "- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [supabase.com/dashboard](https://supabase.com/dashboard), clicking the overflow menu on a bucket and choosing \"Make public\"\n- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "returns-the-url-for-an-asset-in-a-public-bucket", "name": "Returns the URL for an asset in a public bucket", "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png')\n```", "response": "```json\n{\n \"data\": {\n \"publicUrl\": \"https://example.supabase.co/storage/v1/object/public/public-bucket/folder/avatar1.png\"\n }\n}\n```" }, { "id": "returns-the-url-for-an-asset-in-a-public-bucket-with-transformations", "name": "Returns the URL for an asset in a public bucket with transformations", "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png', {\n transform: {\n width: 100,\n height: 100,\n }\n })\n```" }, { "id": "returns-the-url-which-triggers-the-download-of-an-asset-in-a-public-bucket", "name": "Returns the URL which triggers the download of an asset in a public bucket", "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png', {\n download: true,\n })\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.info": { "name": "@supabase/storage-js.packages/StorageFileApi.default.info", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the file name. For example `folder/image.png`." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "Camelize" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Retrieves the details of an existing file.\n\nReturns detailed file metadata including size, content type, and timestamps.\nNote: The API returns `last_modified` field, not `updated_at`.", "examples": [ { "id": "get-file-info", "name": "Get file info", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .info('folder/avatar1.png')\n\nif (data) {\n console.log('Last modified:', data.lastModified)\n console.log('Size:', data.size)\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.list": { "name": "@supabase/storage-js.packages/StorageFileApi.default.list", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The folder path." } }, { "name": "options", "type": { "type": "object", "name": "SearchOptions", "properties": [ { "name": "limit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "The number of files you want to be returned." } }, { "name": "offset", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "The starting position." } }, { "name": "search", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The search string to filter files by." } }, { "name": "sortBy", "type": { "type": "object", "name": "SortBy", "properties": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "order", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "The column to sort by. Can be any column inside a FileObject." } } ] }, "isOptional": true, "comment": { "shortText": "Search options including limit (defaults to 100), offset, sortBy, and search" } }, { "name": "parameters", "type": { "type": "object", "name": "FetchParameters", "properties": [ { "name": "cache", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" } }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true, "comment": { "shortText": "Pass in an AbortController's signal to cancel the request." } } ] }, "isOptional": true, "comment": { "shortText": "Optional fetch parameters including signal for cancellation" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "name": "FileObject", "properties": [ { "name": "bucket_id", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "" } }, { "name": "buckets", "type": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true }, { "name": "created_at", "type": "[Circular]" }, { "name": "file_size_limit", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "name", "type": "[Circular]" }, { "name": "owner", "type": "[Circular]" }, { "name": "public", "type": "[Circular]" }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "type": "[Circular]" } ] }, "isOptional": true, "comment": { "shortText": "" } }, { "name": "created_at", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "comment": { "shortText": "Creation timestamp (null for folders)" } }, { "name": "id", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "comment": { "shortText": "Unique identifier for the file (null for folders)" } }, { "name": "last_accessed_at", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "comment": { "shortText": "" } }, { "name": "metadata", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "object", "name": "FileMetadata", "properties": [ { "name": "cacheControl", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Cache control directive (e.g., \"max-age=3600\")" } }, { "name": "contentLength", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "Content length in bytes (usually same as size)" } }, { "name": "eTag", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Entity tag for caching and conditional requests" } }, { "name": "httpStatusCode", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "HTTP status code from the storage backend" } }, { "name": "lastModified", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Last modification timestamp (ISO 8601)" } }, { "name": "mimetype", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "MIME type of the file" } }, { "name": "size", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "File size in bytes" } } ] } ] }, "comment": { "shortText": "File metadata including size, mimetype, etc. (null for folders)" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "File or folder name (relative to the prefix) - always present" } }, { "name": "owner", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "" } }, { "name": "updated_at", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "comment": { "shortText": "Last update timestamp (null for folders)" } } ] } } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Lists all the files and folders within a path of the bucket.\n\n**Important:** For folder entries, fields like `id`, `updated_at`, `created_at`,\n`last_accessed_at`, and `metadata` will be `null`. Only files have these fields populated.\nAdditionally, deprecated fields like `bucket_id`, `owner`, and `buckets` are NOT returned\nby this method.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "list-files-in-a-bucket", "name": "List files in a bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .list('folder', {\n limit: 100,\n offset: 0,\n sortBy: { column: 'name', order: 'asc' },\n })\n\n// Handle files vs folders\ndata?.forEach(item => {\n if (item.id !== null) {\n // It's a file\n console.log('File:', item.name, 'Size:', item.metadata?.size)\n } else {\n // It's a folder\n console.log('Folder:', item.name)\n }\n})\n```", "response": "```json\n{\n \"data\": [\n {\n \"name\": \"avatar1.png\",\n \"id\": \"e668cf7f-821b-4a2f-9dce-7dfa5dd1cfd2\",\n \"updated_at\": \"2024-05-22T23:06:05.580Z\",\n \"created_at\": \"2024-05-22T23:04:34.443Z\",\n \"last_accessed_at\": \"2024-05-22T23:04:34.443Z\",\n \"metadata\": {\n \"eTag\": \"\\\"c5e8c553235d9af30ef4f6e280790b92\\\"\",\n \"size\": 32175,\n \"mimetype\": \"image/png\",\n \"cacheControl\": \"max-age=3600\",\n \"lastModified\": \"2024-05-22T23:06:05.574Z\",\n \"contentLength\": 32175,\n \"httpStatusCode\": 200\n }\n }\n ],\n \"error\": null\n}\n```" }, { "id": "search-files-in-a-bucket", "name": "Search files in a bucket", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .list('folder', {\n limit: 100,\n offset: 0,\n sortBy: { column: 'name', order: 'asc' },\n search: 'jon'\n })\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.listV2": { "name": "@supabase/storage-js.packages/StorageFileApi.default.listV2", "params": [ { "name": "options", "type": { "type": "object", "name": "SearchV2Options", "properties": [ { "name": "cursor", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The cursor used for pagination. Pass the value received from nextCursor of the previous request." } }, { "name": "limit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "The number of files you want to be returned." } }, { "name": "prefix", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The prefix search string to filter files by." } }, { "name": "sortBy", "type": { "type": "object", "name": "SortByV2", "properties": [ { "name": "column", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "name" }, { "type": "literal", "value": "created_at" }, { "type": "literal", "value": "updated_at" } ] } }, { "name": "order", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "asc" }, { "type": "literal", "value": "desc" } ] }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "The column and order to sort by" } }, { "name": "with_delimiter", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to emulate a hierarchical listing of objects using delimiters.\n\n- When `false` (default), all objects are listed as flat key/value pairs.\n- When `true`, the response groups objects by delimiter, making it appear\n like a file/folder hierarchy." } } ] }, "isOptional": true, "comment": { "shortText": "Search options including prefix, cursor for pagination, limit, with_delimiter" } }, { "name": "parameters", "type": { "type": "object", "name": "FetchParameters", "properties": [ { "name": "cache", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" } }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true, "comment": { "shortText": "Pass in an AbortController's signal to cancel the request." } } ] }, "isOptional": true, "comment": { "shortText": "Optional fetch parameters including signal for cancellation" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "name": "SearchV2Result", "properties": [ { "name": "folders", "type": { "type": "array", "elemType": { "type": "object", "name": "SearchV2Folder", "properties": [ { "name": "key", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Full folder key/path" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Folder name/prefix" } } ] } } }, { "name": "hasNext", "type": { "type": "intrinsic", "name": "boolean" } }, { "name": "nextCursor", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "objects", "type": { "type": "array", "elemType": { "type": "object", "name": "SearchV2Object", "properties": [ { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Creation timestamp" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the file" } }, { "name": "key", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Full object key/path" } }, { "name": "last_accessed_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "" } }, { "name": "metadata", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "object", "name": "FileMetadata", "properties": [ { "name": "cacheControl", "type": "[Circular]", "comment": { "shortText": "Cache control directive (e.g., \"max-age=3600\")" } }, { "name": "contentLength", "type": "[Circular]", "comment": { "shortText": "Content length in bytes (usually same as size)" } }, { "name": "eTag", "type": "[Circular]", "comment": { "shortText": "Entity tag for caching and conditional requests" } }, { "name": "httpStatusCode", "type": "[Circular]", "comment": { "shortText": "HTTP status code from the storage backend" } }, { "name": "lastModified", "type": "[Circular]", "comment": { "shortText": "Last modification timestamp (ISO 8601)" } }, { "name": "mimetype", "type": "[Circular]", "comment": { "shortText": "MIME type of the file" } }, { "name": "size", "type": "[Circular]", "comment": { "shortText": "File size in bytes" } } ] } ] }, "comment": { "shortText": "File metadata including size, mimetype, etc. (null if not yet set)" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "File name" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Last update timestamp" } } ] } } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Lists all the files and folders within a bucket using the V2 API with pagination support.\n\n**Important:** Folder entries in the `folders` array only contain `name` and optionally `key` —\nthey have no `id`, timestamps, or `metadata` fields. Full file metadata is only available\non entries in the `objects` array.\n\n this method signature might change in the future", "tags": [ { "tag": "experimental", "text": "" } ], "examples": [ { "id": "list-files-with-pagination", "name": "List files with pagination", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .listV2({\n prefix: 'folder/',\n limit: 100,\n })\n\n// Handle pagination\nif (data?.hasNext) {\n const nextPage = await supabase\n .storage\n .from('avatars')\n .listV2({\n prefix: 'folder/',\n cursor: data.nextCursor,\n })\n}\n\n// Handle files vs folders\ndata?.objects.forEach(file => {\n if (file.id !== null) {\n console.log('File:', file.name, 'Size:', file.metadata?.size)\n }\n})\ndata?.folders.forEach(folder => {\n console.log('Folder:', folder.name)\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.move": { "name": "@supabase/storage-js.packages/StorageFileApi.default.move", "params": [ { "name": "fromPath", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The original file path, including the current file name. For example `folder/image.png`." } }, { "name": "toPath", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The new file path, including the new file name. For example `folder/image-new.png`." } }, { "name": "options", "type": { "type": "object", "name": "DestinationOptions", "properties": [ { "name": "destinationBucket", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "The destination options." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Moves an existing file to a new path in the same bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `update` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "move-file", "name": "Move file", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .move('public/avatar1.png', 'private/avatar2.png')\n```", "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully moved\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.remove": { "name": "@supabase/storage-js.packages/StorageFileApi.default.remove", "params": [ { "name": "paths", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "An array of files to delete, including the path and file name. For example [`'folder/image.png'`]." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "type": "object", "name": "FileObject", "properties": [ { "name": "bucket_id", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "" } }, { "name": "buckets", "type": { "type": "object", "name": "Bucket", "properties": [ { "name": "allowed_mime_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true }, { "name": "created_at", "type": "[Circular]" }, { "name": "file_size_limit", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "name", "type": "[Circular]" }, { "name": "owner", "type": "[Circular]" }, { "name": "public", "type": "[Circular]" }, { "name": "type", "type": { "type": "union", "name": "BucketType", "subTypes": [ "[Circular]", "[Circular]", null ] }, "isOptional": true }, { "name": "updated_at", "type": "[Circular]" } ] }, "isOptional": true, "comment": { "shortText": "" } }, { "name": "created_at", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Creation timestamp (null for folders)" } }, { "name": "id", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Unique identifier for the file (null for folders)" } }, { "name": "last_accessed_at", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "" } }, { "name": "metadata", "type": { "type": "union", "subTypes": [ "[Circular]", { "type": "object", "name": "FileMetadata", "properties": [ { "name": "cacheControl", "type": "[Circular]", "comment": { "shortText": "Cache control directive (e.g., \"max-age=3600\")" } }, { "name": "contentLength", "type": "[Circular]", "comment": { "shortText": "Content length in bytes (usually same as size)" } }, { "name": "eTag", "type": "[Circular]", "comment": { "shortText": "Entity tag for caching and conditional requests" } }, { "name": "httpStatusCode", "type": "[Circular]", "comment": { "shortText": "HTTP status code from the storage backend" } }, { "name": "lastModified", "type": "[Circular]", "comment": { "shortText": "Last modification timestamp (ISO 8601)" } }, { "name": "mimetype", "type": "[Circular]", "comment": { "shortText": "MIME type of the file" } }, { "name": "size", "type": "[Circular]", "comment": { "shortText": "File size in bytes" } } ] } ] }, "comment": { "shortText": "File metadata including size, mimetype, etc. (null for folders)" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "File or folder name (relative to the prefix) - always present" } }, { "name": "owner", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "" } }, { "name": "updated_at", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Last update timestamp (null for folders)" } } ] } } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Deletes files within the same bucket\n\nReturns an array of FileObject entries for the deleted files. Note that deprecated\nfields like `bucket_id` may or may not be present in the response - do not rely on them.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `delete` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "delete-file", "name": "Delete file", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .remove(['folder/avatar1.png'])\n```", "response": "```json\n{\n \"data\": [],\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.setHeader": { "name": "@supabase/storage-js.packages/StorageFileApi.default.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." } }, "@supabase/storage-js.packages/StorageFileApi.default.throwOnError": { "name": "@supabase/storage-js.packages/StorageFileApi.default.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." } }, "@supabase/storage-js.packages/StorageFileApi.default.toBase64": { "name": "@supabase/storage-js.packages/StorageFileApi.default.toBase64", "params": [ { "name": "data", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "string" } } }, "@supabase/storage-js.packages/StorageFileApi.default.update": { "name": "@supabase/storage-js.packages/StorageFileApi.default.update", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update." } }, { "name": "fileBody", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "ArrayBuffer" }, { "type": "nameOnly", "name": "ReadableStream" }, { "type": "nameOnly", "name": "Blob" }, { "type": "nameOnly", "name": "File" }, { "type": "nameOnly", "name": "FormData" }, { "type": "nameOnly", "name": "@types/node.__global.NodeJS.ReadableStream" }, { "type": "nameOnly", "name": "URLSearchParams" }, { "type": "nameOnly", "name": "ArrayBufferView" }, { "type": "nameOnly", "name": "@types/node.__global.Buffer" } ] }, "comment": { "shortText": "The body of the file to be stored in the bucket." } }, { "name": "fileOptions", "type": { "type": "object", "name": "FileOptions", "properties": [ { "name": "cacheControl", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." } }, { "name": "contentType", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." } }, { "name": "duplex", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." } }, { "name": "headers", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Optionally add extra headers" } }, { "name": "metadata", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." } }, { "name": "upsert", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." } } ] }, "isOptional": true, "comment": { "shortText": "Optional file upload options including cacheControl, contentType, and metadata.\n**Note:** The `upsert` option has no effect here. `update()` always replaces the\nfile at the given path, so the `x-upsert` header is not sent. To control upsert\nbehavior, use `upload()` instead." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "fullPath", "type": { "type": "intrinsic", "name": "string" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "path", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Replaces an existing file at the specified path with a new one.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `update` and `select`\n- `update()` always replaces the file at the given path regardless of the `upsert` option.\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n- For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.", "examples": [ { "id": "update-file", "name": "Update file", "code": "```js\nconst avatarFile = event.target.files[0]\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .update('public/avatar1.png', avatarFile, {\n cacheControl: '3600'\n })\n```", "response": "```json\n{\n \"data\": {\n \"path\": \"public/avatar1.png\",\n \"fullPath\": \"avatars/public/avatar1.png\"\n },\n \"error\": null\n}\n```" }, { "id": "update-file-using-arraybuffer-from-base64-file-data", "name": "Update file using `ArrayBuffer` from base64 file data", "code": "```js\nimport {decode} from 'base64-arraybuffer'\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .update('public/avatar1.png', decode('base64FileData'), {\n contentType: 'image/png'\n })\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.upload": { "name": "@supabase/storage-js.packages/StorageFileApi.default.upload", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload." } }, { "name": "fileBody", "type": { "type": "nameOnly", "name": "FileBody" }, "comment": { "shortText": "The body of the file to be stored in the bucket." } }, { "name": "fileOptions", "type": { "type": "object", "name": "FileOptions", "properties": [ { "name": "cacheControl", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." } }, { "name": "contentType", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." } }, { "name": "duplex", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." } }, { "name": "headers", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Optionally add extra headers" } }, { "name": "metadata", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." } }, { "name": "upsert", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." } } ] }, "isOptional": true, "comment": { "shortText": "Optional file upload options including cacheControl, contentType, upsert, and metadata." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "fullPath", "type": { "type": "intrinsic", "name": "string" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "path", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Uploads a file to an existing bucket.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n- For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.", "examples": [ { "id": "upload-file", "name": "Upload file", "code": "```js\nconst avatarFile = event.target.files[0]\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', avatarFile, {\n cacheControl: '3600',\n upsert: false\n })\n```", "response": "```json\n{\n \"data\": {\n \"path\": \"public/avatar1.png\",\n \"fullPath\": \"avatars/public/avatar1.png\"\n },\n \"error\": null\n}\n```" }, { "id": "upload-file-using-arraybuffer-from-base64-file-data", "name": "Upload file using `ArrayBuffer` from base64 file data", "code": "```js\nimport { decode } from 'base64-arraybuffer'\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', decode('base64FileData'), {\n contentType: 'image/png'\n })\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', avatarFile)\n\nif (error) {\n // Log the full error so fields like `statusCode` and `error` (the\n // Storage error name, e.g. \"Duplicate\") aren't hidden behind `error.message`.\n console.error(error)\n return\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl": { "name": "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl", "params": [ { "name": "path", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload." } }, { "name": "token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The token generated from `createSignedUploadUrl`" } }, { "name": "fileBody", "type": { "type": "nameOnly", "name": "FileBody" }, "comment": { "shortText": "The body of the file to be stored in the bucket." } }, { "name": "fileOptions", "type": { "type": "object", "name": "FileOptions", "properties": [ { "name": "cacheControl", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." } }, { "name": "contentType", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." } }, { "name": "duplex", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." } }, { "name": "headers", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Optionally add extra headers" } }, { "name": "metadata", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." } }, { "name": "upsert", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." } } ] }, "isOptional": true, "comment": { "shortText": "HTTP headers (cacheControl, contentType, etc.).\n**Note:** The `upsert` option has no effect here. To enable upsert behavior,\npass `{ upsert: true }` when calling `createSignedUploadUrl()` instead." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "fullPath", "type": { "type": "intrinsic", "name": "any" } }, { "name": "path", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } }, "comment": { "shortText": "Upload a file with a token generated from `createSignedUploadUrl`.", "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", "examples": [ { "id": "upload-to-a-signed-url", "name": "Upload to a signed URL", "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .uploadToSignedUrl('folder/cat.jpg', 'token-from-createSignedUploadUrl', file)\n```", "response": "```json\n{\n \"data\": {\n \"path\": \"folder/cat.jpg\",\n \"fullPath\": \"avatars/folder/cat.jpg\"\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.constructor": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Base URL of the Storage Vectors REST API." } }, { "name": "options", "type": { "type": "object", "name": "StorageVectorsClientOptions", "properties": [ { "name": "fetch", "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, "comment": { "shortText": "Custom fetch implementation (optional)\nUseful for testing or custom request handling", "tags": [ { "tag": "alpha", "text": "" } ] } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Custom headers to include in all requests", "tags": [ { "tag": "alpha", "text": "" } ] } } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "StorageVectorsClient" } }, "comment": { "shortText": "Creates a StorageVectorsClient that can manage buckets, indexes, and vectors.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "using-supabase-js-recommended", "name": "Using supabase-js (recommended)", "code": "```typescript\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```typescript\nimport { StorageVectorsClient } from '@supabase/storage-js'\n\nconst client = new StorageVectorsClient(url, options)\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket", "params": [ { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique name for the vector bucket" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": { "type": "literal", "value": null }, "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": { "type": "literal", "value": null }, "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Creates a new vector bucket\nVector buckets are containers for vector indexes and their data\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "creating-a-vector-bucket", "name": "Creating a vector bucket", "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .createBucket('embeddings-prod')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket", "params": [ { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the vector bucket to delete" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Deletes a vector bucket (bucket must be empty)\nAll indexes must be deleted before deleting the bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "delete-a-vector-bucket", "name": "Delete a vector bucket", "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .deleteBucket('embeddings-old')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from", "params": [ { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the vector bucket" } } ], "ret": { "type": { "type": "nameOnly", "name": "VectorBucketScope" } }, "comment": { "shortText": "Access operations for a specific vector bucket\nReturns a scoped client for index and vector operations within the bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "accessing-a-vector-bucket", "name": "Accessing a vector bucket", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket", "params": [ { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the vector bucket" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "vectorBucket", "type": { "type": "object", "name": "VectorBucket", "properties": [ { "name": "creationTime", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Unix timestamp of when the bucket was created" } }, { "name": "encryptionConfiguration", "type": { "type": "object", "name": "EncryptionConfiguration", "properties": [ { "name": "kmsKeyArn", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "ARN of the KMS key used for encryption" } }, { "name": "sseType", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Server-side encryption type (e.g., 'KMS')" } } ] }, "isOptional": true, "comment": { "shortText": "Optional encryption settings" } }, { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique name of the vector bucket" } } ] } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Retrieves metadata for a specific vector bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "get-bucket-metadata", "name": "Get bucket metadata", "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .getBucket('embeddings-prod')\n\nconsole.log('Bucket created:', data?.vectorBucket.creationTime)\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets", "params": [ { "name": "options", "type": { "type": "object", "name": "ListVectorBucketsOptions", "properties": [ { "name": "maxResults", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum number of results to return (default: 100)" } }, { "name": "nextToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Token for pagination from previous response" } }, { "name": "prefix", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Filter buckets by name prefix" } } ] }, "comment": { "shortText": "Optional filters (prefix, maxResults, nextToken)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "name": "ListVectorBucketsResponse", "properties": [ { "name": "nextToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Token for fetching next page (if more results exist)" } }, { "name": "vectorBuckets", "type": { "type": "array", "elemType": { "type": "object", "properties": [ { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" } } ] } }, "comment": { "shortText": "Array of bucket names" } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Lists all vector buckets with optional filtering and pagination\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "list-vector-buckets", "name": "List vector buckets", "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .listBuckets({ prefix: 'embeddings-' })\n\ndata?.vectorBuckets.forEach(bucket => {\n console.log(bucket.vectorBucketName)\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.setHeader": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.throwOnError": { "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.constructor": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } } }, { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" } }, { "name": "fetch", "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 } ], "ret": { "type": { "type": "nameOnly", "name": "VectorBucketScope" } }, "comment": { "shortText": "Creates a helper that automatically scopes all index operations to the provided bucket.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "creating-a-vector-bucket-scope", "name": "Creating a vector bucket scope", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Index configuration (vectorBucketName is automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Creates a new vector index in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "creating-a-vector-index", "name": "Creating a vector index", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nawait bucket.createIndex({\n indexName: 'documents-openai',\n dataType: 'float32',\n dimension: 1536,\n distanceMetric: 'cosine',\n metadataConfiguration: {\n nonFilterableMetadataKeys: ['raw_text']\n }\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex", "params": [ { "name": "indexName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the index to delete" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Deletes an index from this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "delete-an-index", "name": "Delete an index", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nawait bucket.deleteIndex('old-index')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex", "params": [ { "name": "indexName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the index to retrieve" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "index", "type": { "type": "object", "name": "VectorIndex", "properties": [ { "name": "creationTime", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Unix timestamp of when the index was created" } }, { "name": "dataType", "type": { "type": "union", "name": "VectorDataType", "subTypes": [ { "type": "literal", "value": "float32" }, null ] }, "comment": { "shortText": "Data type of vector components (currently only 'float32')" } }, { "name": "dimension", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "Dimensionality of vectors (e.g., 384, 768, 1536)" } }, { "name": "distanceMetric", "type": { "type": "union", "name": "DistanceMetric", "subTypes": [ { "type": "literal", "value": "cosine" }, { "type": "literal", "value": "euclidean" }, { "type": "literal", "value": "dotproduct" }, null ] }, "comment": { "shortText": "Similarity metric used for queries" } }, { "name": "indexName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique name of the index within the bucket" } }, { "name": "metadataConfiguration", "type": { "type": "object", "name": "MetadataConfiguration", "properties": [ { "name": "nonFilterableMetadataKeys", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Array of metadata keys that cannot be used in filters" } } ] }, "isOptional": true, "comment": { "shortText": "Configuration for metadata filtering" } }, { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the parent vector bucket" } } ] } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Retrieves metadata for a specific index in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "get-index-metadata", "name": "Get index metadata", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nconst { data } = await bucket.getIndex('documents-openai')\nconsole.log('Dimension:', data?.index.dimension)\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope", "params": [ { "name": "indexName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Name of the index" } } ], "ret": { "type": { "type": "nameOnly", "name": "VectorIndexScope" } }, "comment": { "shortText": "Access operations for a specific index within this bucket\nReturns a scoped client for vector data operations\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "accessing-an-index", "name": "Accessing an index", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\n// Insert vectors\nawait index.putVectors({\n vectors: [\n { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }\n ]\n})\n\n// Query similar vectors\nconst { data } = await index.queryVectors({\n queryVector: { float32: [...] },\n topK: 5\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Listing options (vectorBucketName is automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "name": "ListIndexesResponse", "properties": [ { "name": "indexes", "type": { "type": "array", "elemType": { "type": "object", "properties": [ { "name": "indexName", "type": { "type": "intrinsic", "name": "string" } } ] } }, "comment": { "shortText": "Array of index names" } }, { "name": "nextToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Token for fetching next page (if more results exist)" } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Lists indexes in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "list-indexes", "name": "List indexes", "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nconst { data } = await bucket.listIndexes({ prefix: 'documents-' })\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.setHeader": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.throwOnError": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.constructor": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.constructor", "params": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" } }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } } }, { "name": "vectorBucketName", "type": { "type": "intrinsic", "name": "string" } }, { "name": "indexName", "type": { "type": "intrinsic", "name": "string" } }, { "name": "fetch", "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 } ], "ret": { "type": { "type": "nameOnly", "name": "VectorIndexScope" } }, "comment": { "shortText": "Creates a helper that automatically scopes all vector operations to the provided bucket/index names.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "creating-a-vector-index-scope", "name": "Creating a vector index scope", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Deletion options (bucket and index names automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Deletes vectors by keys from this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "delete-vectors-by-keys", "name": "Delete vectors by keys", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nawait index.deleteVectors({\n keys: ['doc-1', 'doc-2', 'doc-3']\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Vector retrieval options (bucket and index names automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "name": "GetVectorsResponse", "properties": [ { "name": "vectors", "type": { "type": "array", "elemType": { "type": "object", "name": "VectorMatch", "properties": [ { "name": "data", "type": { "type": "object", "name": "VectorData", "properties": [ { "name": "float32", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "number" } }, "comment": { "shortText": "Array of 32-bit floating point numbers" } } ] }, "isOptional": true, "comment": { "shortText": "Vector embedding data (if requested)" } }, { "name": "distance", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Similarity distance from query vector (if requested)" } }, { "name": "key", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the vector" } }, { "name": "metadata", "type": { "type": "record", "name": "VectorMetadata", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Arbitrary metadata (if requested)" } } ] } }, "comment": { "shortText": "Array of retrieved vector objects" } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Retrieves vectors by keys from this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "get-vectors-by-keys", "name": "Get vectors by keys", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.getVectors({\n keys: ['doc-1', 'doc-2'],\n returnMetadata: true\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Listing options (bucket and index names automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "name": "ListVectorsResponse", "properties": [ { "name": "nextToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Token for fetching next page (if more results exist)" } }, { "name": "vectors", "type": { "type": "array", "elemType": { "type": "object", "name": "VectorMatch", "properties": [ { "name": "data", "type": { "type": "object", "name": "VectorData", "properties": [ { "name": "float32", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of 32-bit floating point numbers" } } ] }, "isOptional": true, "comment": { "shortText": "Vector embedding data (if requested)" } }, { "name": "distance", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Similarity distance from query vector (if requested)" } }, { "name": "key", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the vector" } }, { "name": "metadata", "type": { "type": "record", "name": "VectorMetadata", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Arbitrary metadata (if requested)" } } ] } }, "comment": { "shortText": "Array of vector objects" } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Lists vectors in this index with pagination\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "list-vectors-with-pagination", "name": "List vectors with pagination", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.listVectors({\n maxResults: 500,\n returnMetadata: true\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Vector insertion options (bucket and index names automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "intrinsic", "name": "undefined" }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Inserts or updates vectors in this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "insert-vectors-into-an-index", "name": "Insert vectors into an index", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nawait index.putVectors({\n vectors: [\n {\n key: 'doc-1',\n data: { float32: [0.1, 0.2, ...] },\n metadata: { title: 'Introduction', page: 1 }\n }\n ]\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors", "params": [ { "name": "options", "type": { "type": "nameOnly", "name": "Omit" }, "comment": { "shortText": "Query options (bucket and index names automatically set)" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "ApiResponse", "subTypes": [ { "type": "object", "name": "SuccessResponse", "properties": [ { "name": "data", "type": { "type": "object", "name": "QueryVectorsResponse", "properties": [ { "name": "distanceMetric", "type": { "type": "union", "name": "DistanceMetric", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] }, "isOptional": true, "comment": { "shortText": "The distance metric used for the similarity search" } }, { "name": "vectors", "type": { "type": "array", "elemType": { "type": "object", "name": "VectorMatch", "properties": [ { "name": "data", "type": { "type": "object", "name": "VectorData", "properties": [ { "name": "float32", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of 32-bit floating point numbers" } } ] }, "isOptional": true, "comment": { "shortText": "Vector embedding data (if requested)" } }, { "name": "distance", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Similarity distance from query vector (if requested)" } }, { "name": "key", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the vector" } }, { "name": "metadata", "type": { "type": "record", "name": "VectorMetadata", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Arbitrary metadata (if requested)" } } ] } }, "comment": { "shortText": "Array of similar vectors ordered by distance" } } ] }, "comment": { "shortText": "Response data of type T" } }, { "name": "error", "type": "[Circular]", "comment": { "shortText": "Null on success" } } ] }, { "type": "object", "name": "ErrorResponse", "properties": [ { "name": "data", "type": "[Circular]", "comment": { "shortText": "Null on error" } }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" }, "comment": { "shortText": "StorageError with details (named StorageVectorsError for vector operations)" } } ] } ] } } }, "comment": { "shortText": "Queries for similar vectors in this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", "tags": [ { "tag": "alpha", "text": "" } ], "examples": [ { "id": "query-similar-vectors", "name": "Query similar vectors", "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.queryVectors({\n queryVector: { float32: [0.1, 0.2, ...] },\n topK: 5,\n filter: { category: 'technical' },\n returnDistance: true,\n returnMetadata: true\n})\n```" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.setHeader": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.throwOnError": { "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.throwOnError", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", "tags": [ { "tag": "alpha", "text": "" } ] } }, "@supabase/storage-js.packages/StreamDownloadBuilder.default.constructor": { "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.constructor", "params": [ { "name": "downloadFn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "Response" } } } } }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" } } ], "ret": { "type": { "type": "nameOnly", "name": "default" } } }, "@supabase/storage-js.packages/StreamDownloadBuilder.default.catch": { "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.catch", "params": [ { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "ReadableStream" } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] }, { "type": "nameOnly", "name": "TResult" } ] } } }, "comment": { "shortText": "Attaches a callback for only the rejection of the Promise." } }, "@supabase/storage-js.packages/StreamDownloadBuilder.default.finally": { "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.finally", "params": [ { "name": "onfinally", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is settled (fulfilled or rejected)." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "ReadableStream" } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } }, "comment": { "shortText": "Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\nresolved value cannot be modified from the callback." } }, "@supabase/storage-js.packages/StreamDownloadBuilder.default.then": { "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value", "type": { "type": "union", "name": "DownloadResult", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "ReadableStream" } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": { "type": "nameOnly", "name": "StorageError" } } ] } ] } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "TResult2" } ] } } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/supabase-js.AuthApiError.constructor": { "name": "@supabase/supabase-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/supabase-js.AuthApiError.toJSON": { "name": "@supabase/supabase-js.AuthApiError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthError.constructor": { "name": "@supabase/supabase-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/supabase-js.AuthError.toJSON": { "name": "@supabase/supabase-js.AuthError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthImplicitGrantRedirectError.constructor": { "name": "@supabase/supabase-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" } } ] } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "AuthImplicitGrantRedirectError" } } }, "@supabase/supabase-js.AuthImplicitGrantRedirectError.toJSON": { "name": "@supabase/supabase-js.AuthImplicitGrantRedirectError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthInvalidCredentialsError.constructor": { "name": "@supabase/supabase-js.AuthInvalidCredentialsError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "AuthInvalidCredentialsError" } } }, "@supabase/supabase-js.AuthInvalidCredentialsError.toJSON": { "name": "@supabase/supabase-js.AuthInvalidCredentialsError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthInvalidJwtError.constructor": { "name": "@supabase/supabase-js.AuthInvalidJwtError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "AuthInvalidJwtError" } } }, "@supabase/supabase-js.AuthInvalidJwtError.toJSON": { "name": "@supabase/supabase-js.AuthInvalidJwtError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthInvalidTokenResponseError.constructor": { "name": "@supabase/supabase-js.AuthInvalidTokenResponseError.constructor", "params": [], "ret": { "type": { "type": "nameOnly", "name": "AuthInvalidTokenResponseError" } } }, "@supabase/supabase-js.AuthInvalidTokenResponseError.toJSON": { "name": "@supabase/supabase-js.AuthInvalidTokenResponseError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthPKCECodeVerifierMissingError.constructor": { "name": "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.constructor", "params": [], "ret": { "type": { "type": "nameOnly", "name": "AuthPKCECodeVerifierMissingError" } } }, "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.toJSON": { "name": "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthPKCEGrantCodeExchangeError.constructor": { "name": "@supabase/supabase-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" } } ] } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "AuthPKCEGrantCodeExchangeError" } } }, "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.toJSON": { "name": "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthRefreshDiscardedError.constructor": { "name": "@supabase/supabase-js.AuthRefreshDiscardedError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "AuthRefreshDiscardedError" } } }, "@supabase/supabase-js.AuthRefreshDiscardedError.toJSON": { "name": "@supabase/supabase-js.AuthRefreshDiscardedError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthRetryableFetchError.constructor": { "name": "@supabase/supabase-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/supabase-js.AuthRetryableFetchError.toJSON": { "name": "@supabase/supabase-js.AuthRetryableFetchError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthSessionMissingError.constructor": { "name": "@supabase/supabase-js.AuthSessionMissingError.constructor", "params": [], "ret": { "type": { "type": "nameOnly", "name": "AuthSessionMissingError" } } }, "@supabase/supabase-js.AuthSessionMissingError.toJSON": { "name": "@supabase/supabase-js.AuthSessionMissingError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthUnknownError.constructor": { "name": "@supabase/supabase-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/supabase-js.AuthUnknownError.toJSON": { "name": "@supabase/supabase-js.AuthUnknownError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.AuthWeakPasswordError.constructor": { "name": "@supabase/supabase-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/supabase-js.AuthWeakPasswordError.toJSON": { "name": "@supabase/supabase-js.AuthWeakPasswordError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.CustomAuthError.constructor": { "name": "@supabase/supabase-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/supabase-js.CustomAuthError.toJSON": { "name": "@supabase/supabase-js.CustomAuthError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "nameOnly", "name": "ErrorCode" }, null ] } }, { "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/supabase-js.FunctionsError.constructor": { "name": "@supabase/supabase-js.FunctionsError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "context", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "FunctionsError" } } }, "@supabase/supabase-js.FunctionsError.toJSON": { "name": "@supabase/supabase-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/supabase-js.FunctionsFetchError.constructor": { "name": "@supabase/supabase-js.FunctionsFetchError.constructor", "params": [ { "name": "context", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "nameOnly", "name": "FunctionsFetchError" } } }, "@supabase/supabase-js.FunctionsFetchError.toJSON": { "name": "@supabase/supabase-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/supabase-js.FunctionsHttpError.constructor": { "name": "@supabase/supabase-js.FunctionsHttpError.constructor", "params": [ { "name": "context", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "nameOnly", "name": "FunctionsHttpError" } } }, "@supabase/supabase-js.FunctionsHttpError.toJSON": { "name": "@supabase/supabase-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/supabase-js.FunctionsRelayError.constructor": { "name": "@supabase/supabase-js.FunctionsRelayError.constructor", "params": [ { "name": "context", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "nameOnly", "name": "FunctionsRelayError" } } }, "@supabase/supabase-js.FunctionsRelayError.toJSON": { "name": "@supabase/supabase-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/supabase-js.GoTrueAdminApi.constructor": { "name": "@supabase/supabase-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": "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": "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/supabase-js.GoTrueAdminApi.createUser": { "name": "@supabase/supabase-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": "AuthUser", "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": "webauthn" }, { "type": "literal", "value": "totp" }, { "type": "literal", "value": "phone" } ] }, "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": "webauthn" }, { "type": "literal", "value": "totp" }, { "type": "literal", "value": "phone" } ] }, "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: 'user@email.com',\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: 'example@email.com',\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\": \"example@email.com\",\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@example.com\"\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: 'user@email.com',\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/supabase-js.GoTrueAdminApi.deleteUser": { "name": "@supabase/supabase-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" }, "isOptional": true, "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": "AuthUser", "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/supabase-js.GoTrueAdminApi.generateLink": { "name": "@supabase/supabase-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": "AuthUser", "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@example.com',\n password: 'secret'\n})\n```", "response": "```json\n{\n \"data\": {\n \"properties\": {\n \"action_link\": \"\",\n \"email_otp\": \"999999\",\n \"hashed_token\": \"\",\n \"verification_type\": \"signup\"\n },\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"email@example.com\",\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@example.com\",\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@example.com\"\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@example.com'\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@example.com'\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@example.com'\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: 'current.email@example.com',\n newEmail: 'new.email@example.com'\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: 'current.email@example.com',\n newEmail: 'new.email@example.com'\n})\n```" } ] } }, "@supabase/supabase-js.GoTrueAdminApi.getUserById": { "name": "@supabase/supabase-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": "AuthUser", "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: 'example@email.com',\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\": \"example@email.com\",\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@example.com\"\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/supabase-js.GoTrueAdminApi.inviteUserByEmail": { "name": "@supabase/supabase-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." } } ] }, "isOptional": true, "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": "AuthUser", "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@example.com')\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueAdminApi.listUsers": { "name": "@supabase/supabase-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/supabase-js.GoTrueAdminApi.signOut": { "name": "@supabase/supabase-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" } ] }, "isOptional": true, "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/supabase-js.GoTrueAdminApi.updateUserById": { "name": "@supabase/supabase-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": "AuthUser", "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: 'new@email.com' }\n)\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"new@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueClient.constructor": { "name": "@supabase/supabase-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/supabase-js.GoTrueClient._refreshSession": { "name": "@supabase/supabase-js.GoTrueClient._refreshSession", "params": [ { "name": "currentSession", "type": { "type": "object", "properties": [ { "name": "refresh_token", "type": { "type": "intrinsic", "name": "string" } } ] }, "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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" } } ] } ] } } } }, "@supabase/supabase-js.GoTrueClient._setSession": { "name": "@supabase/supabase-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" } } ] } } ], "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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" } } ] } ] } } } }, "@supabase/supabase-js.GoTrueClient._signOut": { "name": "@supabase/supabase-js.GoTrueClient._signOut", "params": [ { "type": { "name": "SignOut", "type": "object", "properties": [ { "name": "scope", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "global" }, { "type": "literal", "value": "local" }, { "type": "literal", "value": "others" } ] }, "isOptional": true, "comment": { "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "object", "properties": [ { "name": "error", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "nameOnly", "name": "AuthError" } ] } } ] } } } }, "@supabase/supabase-js.GoTrueClient._updateUser": { "name": "@supabase/supabase-js.GoTrueClient._updateUser", "params": [ { "name": "attributes", "type": { "type": "object", "name": "UserAttributes", "properties": [ { "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": "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": "email", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The user's email." } }, { "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": "phone", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The user's phone." } } ] } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "emailRedirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "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": "AuthUser", "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" } } ] } ] } } } }, "@supabase/supabase-js.GoTrueClient.dispose": { "name": "@supabase/supabase-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/supabase-js.GoTrueClient.exchangeCodeForSession": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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: '',\n token_type: 'bearer',\n expires_in: 3600,\n expires_at: 1700000000,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com'\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 \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n 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\": \"example@email.com\",\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@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"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\": \"example@email.com\"\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: '',\n provider_refresh_token: ''\n },\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n 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\": \"example@email.com\",\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@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"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\": \"example@email.com\"\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/supabase-js.GoTrueClient.getClaims": { "name": "@supabase/supabase-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": "" } } ] }, "isOptional": true, "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\": \"example@email.com\",\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/supabase-js.GoTrueClient.getSession": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueClient.getUser": { "name": "@supabase/supabase-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": "AuthUser", "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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueClient.getUserIdentities": { "name": "@supabase/supabase-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\": \"example@email.com\",\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\": \"example@email.com\"\n }\n ]\n },\n \"error\": null\n}\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.initialize": { "name": "@supabase/supabase-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/supabase-js.GoTrueClient.isThrowOnErrorEnabled": { "name": "@supabase/supabase-js.GoTrueClient.isThrowOnErrorEnabled", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns whether error throwing mode is enabled for this client." } }, "@supabase/supabase-js.GoTrueClient.linkIdentity": { "name": "@supabase/supabase-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." }, "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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/supabase-js.GoTrueClient.onAuthStateChange": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthSession", "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": "AuthUser", "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." }, "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": "AuthSession", "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": "AuthUser", "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": "AuthSession", "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": "AuthUser", "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/supabase-js.GoTrueClient.reauthenticate": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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": "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/supabase-js.GoTrueClient.refreshSession": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueClient.registerPasskey": { "name": "@supabase/supabase-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/supabase-js.GoTrueClient.resend": { "name": "@supabase/supabase-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@example.com',\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@example.com'\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/supabase-js.GoTrueClient.resetPasswordForEmail": { "name": "@supabase/supabase-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." } } ] }, "isOptional": true } ], "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('user@email.com')\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/supabase-js.GoTrueClient.setSession": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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/supabase-js.GoTrueClient.signInAnonymously": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"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/supabase-js.GoTrueClient.signInWithIdToken": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"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/supabase-js.GoTrueClient.signInWithOAuth": { "name": "@supabase/supabase-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: \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/supabase-js.GoTrueClient.signInWithOtp": { "name": "@supabase/supabase-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: 'example@email.com',\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/supabase-js.GoTrueClient.signInWithPasskey": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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/supabase-js.GoTrueClient.signInWithPassword": { "name": "@supabase/supabase-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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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": "weakPassword", "type": { "name": "WeakPassword", "type": "object", "properties": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "reasons", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "WeakPasswordReasons" } } } ] }, "isOptional": true } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "session", "type": "[Circular]" }, { "name": "user", "type": "[Circular]" }, { "name": "weakPassword", "type": "[Circular]" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Log in an existing user with an email and password or phone and password.\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\nemail/phone and password combination is wrong or that the account can only\nbe accessed via social login.", "text": "- Requires either an email and password or a phone number and password.", "examples": [ { "id": "sign-in-with-email-and-password", "name": "Sign in with email and password", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\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```" }, { "id": "sign-in-with-phone-and-password", "name": "Sign in with phone and password", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n phone: '+13334445555',\n password: 'some-password',\n})\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\nif (error) {\n console.error(error)\n return\n}\n```", "description": "Log the full `error` object so fields like `code`, `status`, and `name` aren't hidden. The `error.code` (e.g. `'invalid_credentials'`, `'email_not_confirmed'`) is often more useful for branching than `error.message`, and the full object surfaces both." } ] } }, "@supabase/supabase-js.GoTrueClient.signInWithSSO": { "name": "@supabase/supabase-js.GoTrueClient.signInWithSSO", "params": [ { "name": "params", "type": { "type": "union", "name": "SignInWithSSO", "subTypes": [ { "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they have signed-in." } }, { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." } } ] }, "isOptional": true }, { "name": "providerId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the SSO provider to invoke single-sign on to." } } ] }, { "type": "object", "properties": [ { "name": "domain", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Domain name of the organization for which to invoke single-sign on." } }, { "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": "A URL to send the user to after they have signed-in." } }, { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." } } ] }, "isOptional": true } ] } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "SSOResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL to open in a browser which will complete the sign-in flow by\ntaking the user to the identity provider's authentication flow.\n\nOn browsers you can set the URL to `window.location.href` to take\nthe user to the authentication flow." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Attempts a single-sign on using an enterprise Identity Provider. A\nsuccessful SSO attempt will redirect the current page to the identity\nprovider authorization page. The redirect URL is implementation and SSO\nprotocol specific.\n\nYou can use it by providing a SSO domain. Typically you can extract this\ndomain by asking users for their email address. If this domain is\nregistered on the Auth instance the redirect will use that organization's\ncurrently active SSO Identity Provider for the login.\n\nIf you have built an organization-specific login page, you can use the\norganization's SSO Identity Provider UUID directly instead.", "text": "- Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this.\n- If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow.\n- In case you need to use a different way to start the authentication flow with an identity provider, you can use the `providerId` property. For example:\n - Mapping specific user email addresses with an identity provider.\n - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information.", "examples": [ { "id": "sign-in-with-email-domain", "name": "Sign in with email domain", "code": "```js\n // You can extract the user's email domain and use it to trigger the\n // authentication flow with the correct identity provider.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n domain: 'company.com'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" }, { "id": "sign-in-with-provider-uuid", "name": "Sign in with provider UUID", "code": "```js\n // Useful when you need to map a user's sign in request according\n // to different rules that can't use email domains.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n providerId: '21648a9d-8d5a-4555-a9d1-d6375dc14e92'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.signInWithWeb3": { "name": "@supabase/supabase-js.GoTrueClient.signInWithWeb3", "params": [ { "name": "credentials", "type": { "type": "union", "name": "Web3Credentials", "subTypes": [ { "type": "union", "name": "SolanaWeb3Credentials", "subTypes": [ { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "solana" } }, { "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": "signInWithSolana", "type": { "type": "nameOnly", "name": "Partial" }, "isOptional": true }, { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." } } ] }, "isOptional": true }, { "name": "statement", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" } }, { "name": "wallet", "type": { "name": "SolanaWallet", "type": "object", "properties": [ { "name": "publicKey", "type": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "toBase58", "type": { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "string" } } } } ] }, { "type": "literal", "value": null } ] }, "isOptional": true }, { "name": "signIn", "type": { "type": "function", "params": [ { "name": "inputs", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "SolanaSignInInput" } } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "SolanaSignInOutput" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "SolanaSignInOutput" } } ] } } } }, "isOptional": true }, { "name": "signMessage", "type": { "type": "function", "params": [ { "name": "message", "type": { "type": "nameOnly", "name": "Uint8Array" } }, { "name": "encoding", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "utf8" }, { "type": "intrinsic", "name": "string" } ] }, "isOptional": true } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "Uint8Array" } }, { "type": "intrinsic", "name": "undefined" } ] } } }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Wallet interface to use. If not specified will default to `window.solana`." } } ] }, { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "solana" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`." } }, { "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": "signature", "type": { "type": "nameOnly", "name": "Uint8Array" }, "comment": { "shortText": "Ed25519 signature of the message." } } ] } ] }, { "type": "union", "name": "EthereumWeb3Credentials", "subTypes": [ { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "ethereum" } }, { "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": "signInWithEthereum", "type": { "type": "nameOnly", "name": "Partial" }, "isOptional": true }, { "name": "url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." } } ] }, "isOptional": true }, { "name": "statement", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" } }, { "name": "wallet", "type": { "type": "nameOnly", "name": "EthereumWallet" }, "isOptional": true, "comment": { "shortText": "Wallet interface to use. If not specified will default to `window.ethereum`." } } ] }, { "type": "object", "properties": [ { "name": "chain", "type": { "type": "literal", "value": "ethereum" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`." } }, { "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": "signature", "type": { "type": "nameOnly", "name": "Hex" }, "comment": { "shortText": "Ethereum curve (secp256k1) signature of the message." } } ] } ] } ] } } ], "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "session", "type": { "type": "literal", "value": null } }, { "name": "user", "type": { "type": "literal", "value": null } } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Signs in a user by verifying a message signed by the user's private key.\nSupports Ethereum (via Sign-In-With-Ethereum) & Solana (Sign-In-With-Solana) standards,\nboth of which derive from the EIP-4361 standard\nWith slight variation on Solana's side.", "text": "- Uses a Web3 (Ethereum, Solana) wallet to sign a user in.\n- Read up on the [potential for abuse](/docs/guides/auth/auth-web3#potential-for-abuse) before using it.", "examples": [ { "id": "sign-in-with-solana-or-ethereum-window-api", "name": "Sign in with Solana or Ethereum (Window API)", "code": "```js\n // uses window.ethereum for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n\n // uses window.solana for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n```" }, { "id": "sign-in-with-ethereum-message-and-signature", "name": "Sign in with Ethereum (Message and Signature)", "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n message: '',\n signature: '',\n })\n```" }, { "id": "sign-in-with-solana-brave", "name": "Sign in with Solana (Brave)", "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet: window.braveSolana\n })\n```" }, { "id": "sign-in-with-solana-wallet-adapter", "name": "Sign in with Solana (Wallet Adapter)", "code": "```jsx\n function SignInButton() {\n const wallet = useWallet()\n\n return (\n <>\n {wallet.connected ? (\n {\n supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet,\n })\n }}\n >\n Sign in with Solana\n \n ) : (\n \n )}\n \n )\n}\n\nfunction App() {\n const endpoint = clusterApiUrl('devnet')\n const wallets = useMemo(() => [], [])\n\n return (\n \n \n \n \n \n \n \n )\n}\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.signOut": { "name": "@supabase/supabase-js.GoTrueClient.signOut", "params": [ { "name": "options", "type": { "name": "SignOut", "type": "object", "properties": [ { "name": "scope", "type": { "type": "union", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "object", "properties": [ { "name": "error", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "nameOnly", "name": "AuthError" } ] } } ] } } }, "comment": { "shortText": "Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `\"SIGNED_OUT\"` event.\n\nFor server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.\nThere is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.\n\nIf using `others` scope, no `SIGNED_OUT` event is fired!\n\n**Warning:** the default `scope` is `'global'`. This signs the user out of\n**every device they are currently signed in on**, not just the current\ntab/session. If you only want to sign the user out of the current session\n(the behavior most other auth libraries default to), pass\n`{ scope: 'local' }` explicitly.", "text": "- In order to use the `signOut()` method, the user needs to be signed in first.\n- By default, `signOut()` uses the **global** scope, which signs out the user\n on every device they are signed in on (not just the current one). Pass\n `{ scope: 'local' }` to only sign out the current session. This is\n usually what apps want on a \"Sign out\" button, especially when users\n sign in from multiple devices and do not expect signing out of one to\n terminate the others.\n- Since Supabase Auth uses JWTs for authentication, the access token JWT will be valid until it's expired. When the user signs out, Supabase revokes the refresh token and deletes the JWT from the client-side. This does not revoke the JWT and it will still be valid until it expires.", "examples": [ { "id": "sign-out-of-every-device-global-default", "name": "Sign out of every device (global – default)", "code": "```js\nconst { error } = await supabase.auth.signOut()\n```" }, { "id": "sign-out-only-the-current-session-recommended-for-most-apps", "name": "Sign out only the current session (recommended for most apps)", "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'local' })\n```" }, { "id": "sign-out-of-all-other-sessions-keep-the-current-one", "name": "Sign out of all other sessions, keep the current one", "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'others' })\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.signUp": { "name": "@supabase/supabase-js.GoTrueClient.signUp", "params": [ { "name": "credentials", "type": { "type": "nameOnly", "name": "SignUpWithPasswordCredentials" } } ], "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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 user.\n\nBe aware that if a user account exists in the system you may get back an\nerror message that attempts to hide this information from the user.\nThis method has support for PKCE via email signups. The PKCE flow cannot be used when autoconfirm is enabled.", "text": "- By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](/dashboard/project/_/auth/providers).\n- **Confirm email** determines if users need to confirm their email address after signing up.\n - If **Confirm email** is enabled, a `user` is returned but `session` is null.\n - If **Confirm email** is disabled, both a `user` and a `session` are returned.\n- When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration).\n- If signUp() is called for an existing confirmed user:\n - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned.\n - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned.\n- To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).", "examples": [ { "id": "sign-up-with-an-email-and-password", "name": "Sign up with an email and password", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", "response": "```json\n// Some fields may be null if \"confirm email\" is enabled.\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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 \"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\": \"example@email.com\",\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\": \"example@email.com\"\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```" }, { "id": "sign-up-with-a-phone-number-and-password-sms", "name": "Sign up with a phone number and password (SMS)", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'sms'\n }\n})\n```" }, { "id": "sign-up-with-a-phone-number-and-password-whatsapp", "name": "Sign up with a phone number and password (whatsapp)", "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\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." }, { "id": "sign-up-with-additional-user-metadata", "name": "Sign up with additional user metadata", "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n data: {\n first_name: 'John',\n age: 27,\n }\n }\n }\n)\n```" }, { "id": "sign-up-with-a-redirect-url", "name": "Sign up with a redirect URL", "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n }\n)\n```", "description": "- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." } ] } }, "@supabase/supabase-js.GoTrueClient.startAutoRefresh": { "name": "@supabase/supabase-js.GoTrueClient.startAutoRefresh", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Starts an auto-refresh process in the background. The session is checked\nevery few seconds. Close to the time of expiration a process is started to\nrefresh the session. If refreshing fails it will be retried for as long as\nnecessary.\n\nIf you set the GoTrueClientOptions#autoRefreshToken you don't need\nto call this function, it will be called for you.\n\nOn browsers the refresh process works only when the tab/window is in the\nforeground to conserve resources as well as prevent race conditions and\nflooding auth with requests. If you call this method any managed\nvisibility change callback will be removed and you must manage visibility\nchanges on your own.\n\nOn non-browser platforms the refresh process works *continuously* in the\nbackground, which may not be desirable. You should hook into your\nplatform's foreground indication mechanism and call these methods\nappropriately to conserve resources.\n\n#stopAutoRefresh", "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- To give this hint to the application, you should be calling this method when the app is in focus and calling `supabase.auth.stopAutoRefresh()` when it's out of focus.", "examples": [ { "id": "start-and-stop-auto-refresh-in-react-native", "name": "Start and stop auto refresh in React Native", "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.stopAutoRefresh": { "name": "@supabase/supabase-js.GoTrueClient.stopAutoRefresh", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Stops an active auto refresh process running in the background (if any).\n\nIf you call this method any managed visibility change callback will be\nremoved and you must manage visibility changes on your own.\n\nSee #startAutoRefresh for more details.", "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- When your application goes in the background or out of focus, call this method to stop the proactive refreshing of the session.", "examples": [ { "id": "start-and-stop-auto-refresh-in-react-native", "name": "Start and stop auto refresh in React Native", "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.unlinkIdentity": { "name": "@supabase/supabase-js.GoTrueClient.unlinkIdentity", "params": [ { "name": "identity", "type": { "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]" } ] } } ], "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": "Unlinks an identity from a user by deleting it. The user will no longer be able to sign in with that identity once it's unlinked.", "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 `unlinkIdentity()`.\n- The user must have at least 2 identities in order to unlink an identity.\n- The identity to be unlinked must belong to the user.", "examples": [ { "id": "unlink-an-identity", "name": "Unlink an identity", "code": "```js\n// retrieve all identities linked to a user\nconst identities = await supabase.auth.getUserIdentities()\n\n// find the google identity\nconst googleIdentity = identities.find(\n identity => identity.provider === 'google'\n)\n\n// unlink the google identity\nconst { error } = await supabase.auth.unlinkIdentity(googleIdentity)\n```" } ] } }, "@supabase/supabase-js.GoTrueClient.updateUser": { "name": "@supabase/supabase-js.GoTrueClient.updateUser", "params": [ { "name": "attributes", "type": { "type": "object", "name": "UserAttributes", "properties": [ { "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": "data", "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\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." } }, { "name": "email", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The user's email." } }, { "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": "phone", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The user's phone." } } ] } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "emailRedirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "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": "AuthUser", "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 user data for a logged in user.", "text": "- In order to use the `updateUser()` method, the user needs to be signed in first.\n- By default, email updates sends a confirmation link to both the user's current and new email.\nTo only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](/dashboard/project/_/auth/providers).", "examples": [ { "id": "update-the-email-for-an-authenticated-user", "name": "Update the email for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n email: 'new@email.com'\n})\n```", "description": "Sends a \"Confirm Email Change\" email to the new address. If **Secure Email Change** is enabled (default), confirmation is also required from the **old email** before the change is applied. To skip dual confirmation and apply the change after only the new email is verified, disable **Secure Email Change** in the [Email Auth Provider settings](/dashboard/project/_/auth/providers?provider=Email).", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"new_email\": \"new@email.com\",\n \"email_change_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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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": "update-the-phone-number-for-an-authenticated-user", "name": "Update the phone number for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n phone: '123456789'\n})\n```", "description": "Sends a one-time password (OTP) to the new phone number." }, { "id": "update-the-password-for-an-authenticated-user", "name": "Update the password for an authenticated user", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password'\n})\n```" }, { "id": "update-the-user-s-metadata", "name": "Update the user's metadata", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n data: { hello: 'world' }\n})\n```", "description": "Updates the user's custom metadata.\n\n**Note**: The `data` field maps to the `auth.users.raw_user_meta_data` column in your Supabase database. When calling `getUser()`, the data will be available as `user.user_metadata`." }, { "id": "update-the-user-s-password-with-a-nonce", "name": "Update the user's password with a nonce", "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password',\n nonce: '123456'\n})\n```", "description": "If **Secure password change** is enabled in your [project's email provider settings](/dashboard/project/_/auth/providers), updating the user's password would require a nonce if the user **hasn't recently signed in**. The nonce is sent to the user's email or phone number. A user is deemed recently signed in if the session was created in the last 24 hours." } ] } }, "@supabase/supabase-js.GoTrueClient.verifyOtp": { "name": "@supabase/supabase-js.GoTrueClient.verifyOtp", "params": [ { "name": "params", "type": { "type": "union", "name": "VerifyOtpParams", "subTypes": [ { "type": "object", "name": "VerifyMobileOtpParams", "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they are confirmed." } } ] }, "isOptional": true }, { "name": "phone", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The user's phone number." } }, { "name": "token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The otp sent to the user's phone number." } }, { "name": "type", "type": { "type": "union", "name": "MobileOtpType", "subTypes": [ { "type": "literal", "value": "sms" }, { "type": "literal", "value": "phone_change" }, null ] }, "comment": { "shortText": "The user's verification type." } } ] }, { "type": "object", "name": "VerifyEmailOtpParams", "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": "redirectTo", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A URL to send the user to after they are confirmed." } } ] }, "isOptional": true }, { "name": "token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The otp sent to the user's email address." } }, { "name": "type", "type": { "type": "union", "name": "EmailOtpType", "subTypes": [ { "type": "literal", "value": "signup" }, { "type": "literal", "value": "invite" }, { "type": "literal", "value": "magiclink" }, { "type": "literal", "value": "recovery" }, { "type": "literal", "value": "email_change" }, { "type": "literal", "value": "email" }, null ] }, "comment": { "shortText": "The user's verification type." } } ] }, { "type": "object", "name": "VerifyTokenHashParams", "properties": [ { "name": "token_hash", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The token hash used in an email link" } }, { "name": "type", "type": { "type": "union", "name": "EmailOtpType", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", "[Circular]", null ] }, "comment": { "shortText": "The user's verification type." } } ] } ] } } ], "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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": "Log in a user given a User supplied OTP or TokenHash received through mobile or email.", "text": "- The `verifyOtp` method takes in different verification types.\n- If a phone number is used, the type can either be:\n 1. `sms` – Used when verifying a one-time password (OTP) sent via SMS during sign-up or sign-in.\n 2. `phone_change` – Used when verifying an OTP sent to a new phone number during a phone number update process.\n- If an email address is used, the type can be one of the following (note: `signup` and `magiclink` types are deprecated):\n 1. `email` – Used when verifying an OTP sent to the user's email during sign-up or sign-in.\n 2. `recovery` – Used when verifying an OTP sent for account recovery, typically after a password reset request.\n 3. `invite` – Used when verifying an OTP sent as part of an invitation to join a project or organization.\n 4. `email_change` – Used when verifying an OTP sent to a new email address during an email update process.\n- The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.\n- The `TokenHash` is contained in the [email templates](/docs/guides/auth/auth-email-templates) and can be used to sign in. You may wish to use the hash for the PKCE flow for Server Side Auth. Read [the Password-based Auth guide](/docs/guides/auth/passwords) for more details.", "examples": [ { "id": "verify-signup-one-time-password-otp", "name": "Verify Signup One-Time Password (OTP)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'email'})\n```", "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\",\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\": \"example@email.com\"\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": "verify-sms-one-time-password-otp", "name": "Verify SMS One-Time Password (OTP)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})\n```" }, { "id": "verify-email-auth-token-hash", "name": "Verify Email Auth (Token Hash)", "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ token_hash: tokenHash, type: 'email'})\n```" } ] } }, "@supabase/supabase-js.NavigatorLockAcquireTimeoutError.constructor": { "name": "@supabase/supabase-js.NavigatorLockAcquireTimeoutError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "nameOnly", "name": "NavigatorLockAcquireTimeoutError" } } }, "@supabase/supabase-js.PostgrestBuilder.constructor": { "name": "@supabase/supabase-js.PostgrestBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "isOptional": true }, { "name": "fetch", "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" }, { "type": "literal", "value": "HEAD" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/supabase-js.PostgrestBuilder.overrideTypes": { "name": "@supabase/supabase-js.PostgrestBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/supabase-js.PostgrestBuilder.retry": { "name": "@supabase/supabase-js.PostgrestBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/supabase-js.PostgrestBuilder.returns": { "name": "@supabase/supabase-js.PostgrestBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`." } }, "@supabase/supabase-js.PostgrestBuilder.setHeader": { "name": "@supabase/supabase-js.PostgrestBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestBuilder.stripNulls": { "name": "@supabase/supabase-js.PostgrestBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestBuilder.then": { "name": "@supabase/supabase-js.PostgrestBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/supabase-js.PostgrestBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/supabase-js.PostgrestError.constructor": { "name": "@supabase/supabase-js.PostgrestError.constructor", "params": [ { "name": "context", "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "intrinsic", "name": "string" } }, { "name": "details", "type": { "type": "intrinsic", "name": "string" } }, { "name": "hint", "type": { "type": "intrinsic", "name": "string" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestError" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nimport PostgrestError from '@supabase/postgrest-js'\n\nthrow new PostgrestError({\n message: 'Row level security prevented the request',\n details: 'RLS denied the insert',\n hint: 'Check your policies',\n code: 'PGRST301',\n})\n```" } ] } }, "@supabase/supabase-js.PostgrestError.toJSON": { "name": "@supabase/supabase-js.PostgrestError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "name": "code", "type": { "type": "intrinsic", "name": "string" } }, { "name": "details", "type": { "type": "intrinsic", "name": "string" } }, { "name": "hint", "type": { "type": "intrinsic", "name": "string" } }, { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" } } ] } } }, "@supabase/supabase-js.PostgrestFilterBuilder.constructor": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "isOptional": true }, { "name": "fetch", "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" }, { "type": "literal", "value": "HEAD" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.abortSignal": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.abortSignal", "params": [ { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "comment": { "shortText": "The AbortSignal to use for the fetch request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set the AbortSignal for the fetch request.", "text": "You can use this to set a timeout for the request.", "examples": [ { "id": "aborting-requests-in-flight", "name": "Aborting requests in-flight", "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" }, { "id": "set-a-timeout", "name": "Set a timeout", "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.containedBy": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.containedBy", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.contains": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.contains", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } }, { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.csv": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.csv", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a string in CSV format.", "examples": [ { "id": "return-data-as-csv", "name": "Return data as CSV", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.eq": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.eq", "params": [ { "name": "column", "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is equal to `value`.\n\nTo check if the value of `column` is NULL, you should use `.is()` instead.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Leia')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.explain": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.explain", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "analyze", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" } }, { "name": "buffers", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on buffer usage" } }, { "name": "format", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "text" }, { "type": "literal", "value": "json" } ] }, "isOptional": true, "comment": { "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" } }, { "name": "settings", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on configuration\nparameters that affect query planning" } }, { "name": "verbose", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" } }, { "name": "wal", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on WAL record generation" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "PostgrestBuilder" }, { "type": "nameOnly", "name": "PostgrestBuilder" } ] } }, "comment": { "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", "examples": [ { "id": "get-the-execution-plan", "name": "Get the execution plan", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" }, { "id": "get-the-execution-plan-with-analyze-and-verbose", "name": "Get the execution plan with analyze and verbose", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.filter": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.filter", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "FilterOperator" }, { "type": "literal", "value": "not.match" }, { "type": "literal", "value": "not.eq" }, { "type": "literal", "value": "not.neq" }, { "type": "literal", "value": "not.gt" }, { "type": "literal", "value": "not.gte" }, { "type": "literal", "value": "not.lt" }, { "type": "literal", "value": "not.lte" }, { "type": "literal", "value": "not.like" }, { "type": "literal", "value": "not.ilike" }, { "type": "literal", "value": "not.is" }, { "type": "literal", "value": "not.isdistinct" }, { "type": "literal", "value": "not.in" }, { "type": "literal", "value": "not.cs" }, { "type": "literal", "value": "not.cd" }, { "type": "literal", "value": "not.sl" }, { "type": "literal", "value": "not.sr" }, { "type": "literal", "value": "not.nxl" }, { "type": "literal", "value": "not.nxr" }, { "type": "literal", "value": "not.adj" }, { "type": "literal", "value": "not.ov" }, { "type": "literal", "value": "not.fts" }, { "type": "literal", "value": "not.plfts" }, { "type": "literal", "value": "not.phfts" }, { "type": "literal", "value": "not.wfts" }, { "type": "literal", "value": "not.imatch" } ] } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "operator", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.geojson": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.geojson", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." } }, "@supabase/supabase-js.PostgrestFilterBuilder.gt": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.gt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.gte": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.gte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.ilike": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilike", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAllOf": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAllOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAnyOf": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAnyOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.in": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.in", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "values", "type": { "type": "array" }, "comment": { "shortText": "The values array to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is included in the `values` array.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .in('name', ['Leia', 'Han'])\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.is": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.is", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value" } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "boolean" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.isDistinct": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.isDistinct", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` IS DISTINCT FROM `value`.\n\nUnlike `.neq()`, this treats `NULL` as a comparable value. Two `NULL` values\nare considered equal (not distinct), and comparing `NULL` with any non-NULL\nvalue returns true (distinct)." } }, "@supabase/supabase-js.PostgrestFilterBuilder.like": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.like", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.likeAllOf": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.likeAllOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.likeAnyOf": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.likeAnyOf", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "patterns", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.limit": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.limit", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows to return" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by `rows`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\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');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.lt": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.lt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.lte": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.lte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.match": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.match", "params": [ { "name": "query", "type": { "type": "record", "name": "Record", "keyType": { "type": "nameOnly", "name": "ColumnName" }, "valueType": { "type": "nameOnly", "name": "Row['ColumnName']" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "query", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "unknown" } } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.maxAffected": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.maxAffected", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows that can be affected" } } ], "comment": { "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." } }, "@supabase/supabase-js.PostgrestFilterBuilder.maybeSingle": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.maybeSingle", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.neq": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.neq", "params": [ { "name": "column", "comment": { "shortText": "The column to filter on" } }, { "name": "value", "comment": { "shortText": "The value to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is not equal to `value`.\n\nThis filter does not include rows where `column` is `NULL`. To match null\nvalues, use `.is(column, null)` instead.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .neq('name', 'Leia')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.not": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.not", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "literal", "value": "is" } }, { "name": "value", "type": { "type": "literal", "value": null } } ], "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "operator", "type": { "type": "nameOnly", "name": "FilterOperator" } }, { "name": "value", "type": { "type": "nameOnly", "name": "Row['ColumnName']" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "operator", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "intrinsic", "name": "unknown" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.notIn": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.notIn", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" }, "comment": { "shortText": "The column to filter on" } }, { "name": "values", "type": { "type": "array" }, "comment": { "shortText": "The values array to filter with" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows where `column` is NOT included in the `values` array." } }, "@supabase/supabase-js.PostgrestFilterBuilder.or": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.or", "params": [ { "name": "filters", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The filters to use, following PostgREST syntax" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `referencedTable` instead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to filter on referenced tables\ninstead of the parent table" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Match only rows which satisfy at least one of the filters.\n\nUnlike most filters, `filters` is used as-is and needs to follow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure it's properly sanitized.\n\nIt's currently not possible to do an `.or()` filter across multiple tables.", "text": "or() expects you to use the raw PostgREST syntax for the filter names and values.\n\n```ts\n.or('id.in.(5,6,7), arraycol.cs.{\"a\",\"b\"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.\n.or('id.in.(5,6,7), arraycol.cd.{\"a\",\"b\"}') // Use `cd` for `containedBy()`\n```", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.eq.2,name.eq.Han')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n },\n {\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "use-or-with-and", "name": "Use `or` with `and`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.gt.3,and(id.eq.1,name.eq.Luke)')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "use-or-on-referenced-tables", "name": "Use `or` on 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 .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })\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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.order": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.order", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.overlaps": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.overlaps", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "Row['ColumnName']" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "value", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "unknown" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.overrideTypes": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.range": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.range", "params": [ { "name": "from", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The starting index from which to limit the result" } }, { "name": "to", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The last index to which to limit the result" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.rangeAdjacent": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeAdjacent", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.rangeGt": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeGt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.rangeGte": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeGte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.rangeLt": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeLt", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.rangeLte": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeLte", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "range", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.regexIMatch": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.regexIMatch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.regexMatch": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.regexMatch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "pattern", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.retry": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.returns": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`.", "text": "- Deprecated: use overrideTypes method instead", "examples": [ { "id": "override-type-of-successful-response", "name": "Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", "response": "```js\nlet x: typeof data // MyType[]\n```" }, { "id": "override-type-of-object-response", "name": "Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", "response": "```js\nlet x: typeof data // MyType | null\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.rollback": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.rollback", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", "examples": [ { "id": "validate-an-insert-without-persisting", "name": "Validate an insert without persisting", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.select": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", "examples": [ { "id": "with-upsert", "name": "With `upsert()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.setHeader": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestFilterBuilder.single": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.single", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.stripNulls": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.textSearch": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.textSearch", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "query", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "config", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "plain" }, { "type": "literal", "value": "phrase" }, { "type": "literal", "value": "websearch" } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "query", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "config", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "plain" }, { "type": "literal", "value": "phrase" }, { "type": "literal", "value": "websearch" } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestFilterBuilder.then": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/supabase-js.PostgrestQueryBuilder.constructor": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.constructor", "params": [ { "name": "url", "type": { "type": "nameOnly", "name": "URL" }, "comment": { "shortText": "The URL for the query" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "fetch", "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, "comment": { "shortText": "Custom fetch implementation" } }, { "name": "headers", "type": { "type": "nameOnly", "name": "HeadersInit" }, "isOptional": true, "comment": { "shortText": "Custom headers" } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Enable automatic retries for transient errors (default: true)" } }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Postgres schema to use" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum URL length before warning" } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } }, "comment": { "shortText": "Creates a query builder scoped to a Postgres table or view.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst query = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: { apikey: 'your-publishable-key' }, retry: true }\n)\n```" } ] } }, "@supabase/supabase-js.PostgrestQueryBuilder.delete": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.delete", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, null, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count deleted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a DELETE on the table or view.\n\nBy default, deleted rows are not returned. To return it, chain the call\nwith `.select()` after filters.", "text": "- `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.\n- If you use `delete()` with filters and you have\n [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only\n rows visible through `SELECT` policies are deleted. Note that by default\n no rows are visible, so you need at least one `SELECT`/`ALL` policy that\n makes the rows visible.\n- When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.", "examples": [ { "id": "delete-a-single-record", "name": "Delete a single record", "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('countries').delete().eq('id', 1)\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT DELETE ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "delete-a-record-and-return-it", "name": "Delete a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n .select()\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "delete-multiple-records", "name": "Delete multiple records", "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .in('id', [1, 2, 3])\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestQueryBuilder.insert": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.insert", "params": [ { "name": "values", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "RejectExcessProperties" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "RejectExcessProperties" } } ] }, "comment": { "shortText": "The values to insert. Pass an object to insert a single row\nor an array to insert multiple rows." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, null, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count inserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "defaultToNull", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. Only applies for bulk\ninserts." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an INSERT into the table or view.\n\nBy default, inserted rows are not returned. To return it, chain the call\nwith `.select()`.", "examples": [ { "id": "create-a-record", "name": "Create a record", "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('countries').insert({ id: 1, name: 'Mordor' })\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "create-a-record-and-return-it", "name": "Create a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "bulk-create", "name": "Bulk create", "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert([\n { id: 1, name: 'Mordor' },\n { id: 1, name: 'The Shire' },\n ])\n```", "description": "A bulk create operation is handled in a single transaction.\nIf any of the inserts fail, none of the rows are inserted.", "data": { "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" }, "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (id)=(1) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"countries_pkey\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestQueryBuilder.select": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, null, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count rows in the table or view.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "head", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT query on the table or view.", "text": "When using `count` with `.range()` or `.limit()`, the returned `count` is the total number of rows\nthat match your filters, not the number of rows in the current page. Use this to build pagination UI.\n\n- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](/dashboard/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data.\n- `select()` can be combined with [Filters](/docs/reference/javascript/using-filters)\n- `select()` can be combined with [Modifiers](/docs/reference/javascript/using-modifiers)\n- `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465). *", "examples": [ { "id": "getting-your-data", "name": "Getting your data", "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Harry'),\n (2, 'Frodo'),\n (3, 'Katniss');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Harry\"\n },\n {\n \"id\": 2,\n \"name\": \"Frodo\"\n },\n {\n \"id\": 3,\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.from('characters').select()\nif (error) {\n // Logs the full error: message, code, details, and hint.\n console.error(error)\n return\n}\n```", "description": "The most useful field on a Postgres error is usually `hint` — when the database knows the fix, it puts the literal SQL there. For example, a permission-denied error (`code: '42501'`) arrives with a `hint` like `\"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\"`. Log the full `error` object so the hint isn't hidden behind `error.message`.", "response": "```json\n{\n \"error\": {\n \"code\": \"42501\",\n \"details\": null,\n \"hint\": \"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\",\n \"message\": \"permission denied for table characters\"\n },\n \"status\": 401,\n \"statusText\": \"Unauthorized\"\n}\n```" }, { "id": "selecting-specific-columns", "name": "Selecting specific columns", "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Frodo'),\n (2, 'Harry'),\n (3, 'Katniss');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Frodo\"\n },\n {\n \"name\": \"Harry\"\n },\n {\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables", "name": "Query referenced tables", "code": "```js\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n```", "description": "If your database has foreign key relationships, you can query related tables too.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables-with-spaces-in-their-names", "name": "Query referenced tables with spaces in their names", "code": "```js\nconst { data, error } = await supabase\n .from('orchestral sections')\n .select(`\n name,\n \"musical instruments\" (\n name\n )\n `)\n```", "description": "If your table name contains spaces, you must use double quotes in the `select` statement to reference the table.", "data": { "sql": "```sql\ncreate table\n \"orchestral sections\" (id int8 primary key, name text);\ncreate table\n \"musical 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 \"musical instruments\" (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"musical instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"musical instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "query-referenced-tables-through-a-join-table", "name": "Query referenced tables through a join table", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n name,\n teams (\n name\n )\n `)\n\n```", "description": "If you're in a situation where your tables are **NOT** directly\nrelated, but instead are joined by a _join table_, you can still use\nthe `select()` method to query the related data. The join table needs\nto have the foreign keys as part of its composite primary key.", "data": { "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n -- both foreign keys must be part of a composite primary key\n primary key (user_id, team_id)\n );\n\ninsert into\n users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\n```" }, "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Kiran\",\n \"teams\": [\n {\n \"name\": \"Green\"\n },\n {\n \"name\": \"Blue\"\n }\n ]\n },\n {\n \"name\": \"Evan\",\n \"teams\": [\n {\n \"name\": \"Blue\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" }, { "id": "query-the-same-referenced-table-multiple-times", "name": "Query the same referenced table multiple times", "code": "```ts\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:sender_id(name),\n to:receiver_id(name)\n `)\n\n// To infer types, use the name of the table (in this case `users`) and\n// the name of the foreign key constraint.\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:users!messages_sender_id_fkey(name),\n to:users!messages_receiver_id_fkey(name)\n `)\n```", "description": "If you need to query the same referenced table twice, use the name of the\njoined column to identify which join to use. You can also give each\ncolumn an alias.", "data": { "sql": "```sql\n create table\n users (id int8 primary key, name text);\n\n create table\n messages (\n sender_id int8 not null references users,\n receiver_id int8 not null references users,\n content text\n );\n\n insert into\n users (id, name)\n values\n (1, 'Kiran'),\n (2, 'Evan');\n\n insert into\n messages (sender_id, receiver_id, content)\n values\n (1, 2, '👋');\n ```\n```\n\n@exampleResponse Query the same referenced table multiple times\n```json\n{\n \"data\": [\n {\n \"content\": \"👋\",\n \"from\": {\n \"name\": \"Kiran\"\n },\n \"to\": {\n \"name\": \"Evan\"\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n\n@exampleDescription Query nested foreign tables through a join table\nYou can use the result of a joined table to gather data in\nanother foreign table. With multiple references to the same foreign\ntable you must specify the column on which to conduct the join.\n\n@example Query nested foreign tables through a join table\n```ts\n const { data, error } = await supabase\n .from('games')\n .select(`\n game_id:id,\n away_team:teams!games_away_team_fkey (\n users (\n id,\n name\n )\n )\n `)\n\n```\n\n@exampleSql Query nested foreign tables through a join table\n```sql\n```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n\n primary key (user_id, team_id)\n );\ncreate table\n games (\n id int8 primary key,\n home_team int8 not null references teams,\n away_team int8 not null references teams,\n name text\n );\n\ninsert into users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\ninsert into\n games (id, home_team, away_team, name)\nvalues\n (1, 1, 2, 'Green vs Blue'),\n (2, 2, 1, 'Blue vs Green');\n```" } }, { "id": "filtering-through-referenced-tables", "name": "Filtering through referenced tables", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections(*)')\n .eq('orchestral_sections.name', 'percussion')\n```", "description": "If the filter on a referenced table's column is not satisfied, the referenced\ntable returns `[]` or `null` but the parent table is not filtered out.\nIf you want to filter out the parent table rows, use the `!inner` hint", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": null\n },\n {\n \"name\": \"violin\",\n \"orchestral_sections\": null\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-referenced-table-with-count", "name": "Querying referenced table with count", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`*, instruments(count)`)\n```", "description": "You can get the number of rows in a related table by using the\n**count** property.", "data": { "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table characters (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('strings') returning id\n)\ninsert into instruments (name, section_id) values\n('violin', (select id from section)),\n('viola', (select id from section)),\n('cello', (select id from section)),\n('double bass', (select id from section));\n```" }, "response": "```json\n[\n {\n \"id\": \"693694e7-d993-4360-a6d7-6294e325d9b6\",\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"count\": 4\n }\n ]\n }\n]\n```" }, { "id": "querying-with-count-option", "name": "Querying with count option", "code": "```ts\nconst { count, error } = await supabase\n .from('characters')\n .select('*', { count: 'exact', head: true })\n```", "description": "You can get the number of rows by using the\n[count](/docs/reference/javascript/select#parameters) option.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"count\": 3,\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-json-data", "name": "Querying JSON data", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n id, name,\n address->city\n `)\n```", "description": "You can select and filter data inside of\n[JSON](/docs/guides/database/json) columns. Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nquerying JSON data.", "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, 'Frodo', '{\"city\":\"Hobbiton\"}');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Frodo\",\n \"city\": \"Hobbiton\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "querying-referenced-table-with-inner-join", "name": "Querying referenced table with inner join", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections!inner(name)')\n .eq('orchestral_sections.name', 'woodwinds')\n .limit(1)\n```", "description": "If you don't want to return the referenced table contents, you can leave the parenthesis empty.\nLike `.select('name, orchestral_sections!inner()')`.", "data": { "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table instruments (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('woodwinds') returning id\n)\ninsert into instruments (name, section_id) values\n('flute', (select id from section)),\n('clarinet', (select id from section)),\n('bassoon', (select id from section)),\n('piccolo', (select id from section));\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "switching-schemas-per-query", "name": "Switching schemas per query", "code": "```ts\nconst { data, error } = await supabase\n .schema('myschema')\n .from('mytable')\n .select()\n```", "description": "In addition to setting the schema during initialization, you can also switch schemas on a per-query basis.\nMake sure you've set up your [database privileges and API settings](/docs/guides/api/using-custom-schemas).", "data": { "sql": "```sql\ncreate schema myschema;\n\ncreate table myschema.mytable (\n id uuid primary key default gen_random_uuid(),\n data text\n);\n\ninsert into myschema.mytable (data) values ('mydata');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": \"4162e008-27b0-4c0f-82dc-ccaeee9a624d\",\n \"data\": \"mydata\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestQueryBuilder.update": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.update", "params": [ { "name": "values", "type": { "type": "nameOnly", "name": "RejectExcessProperties" }, "comment": { "shortText": "The values to update with" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, null, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count updated rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an UPDATE on the table or view.\n\nBy default, updated rows are not returned. To return it, chain the call\nwith `.select()` after filters.", "text": "- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update.", "examples": [ { "id": "updating-your-data", "name": "Updating your data", "code": "```ts\nconst { error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { error } = await supabase.from('instruments').update({ name: 'piano' }).eq('id', 1)\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "update-a-record-and-return-it", "name": "Update a record and return it", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "updating-json-data", "name": "Updating JSON data", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .update({\n address: {\n street: 'Melrose Place',\n postcode: 90210\n }\n })\n .eq('address->postcode', 90210)\n .select()\n```", "description": "Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nworking with JSON data. Currently, it is only possible to update the entire JSON document.", "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```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"street\": \"Melrose Place\",\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestQueryBuilder.upsert": { "name": "@supabase/supabase-js.PostgrestQueryBuilder.upsert", "params": [ { "name": "values", "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "RejectExcessProperties" }, { "type": "array", "elemType": { "type": "nameOnly", "name": "RejectExcessProperties" } } ] }, "comment": { "shortText": "The values to upsert with. Pass an object to upsert a\nsingle row or an array to upsert multiple rows." } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, null, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count upserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "defaultToNull", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. This only applies when\ninserting new rows, not when merging with existing rows under\n`ignoreDuplicates: false`. This also only applies when doing bulk upserts." } }, { "name": "ignoreDuplicates", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, duplicate rows are ignored. If\n`false`, duplicate rows are merged with existing rows." } }, { "name": "onConflict", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Comma-separated UNIQUE column(s) to specify how\nduplicate rows are determined. Two rows are duplicates if all the\n`onConflict` columns are equal." } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\nto `onConflict`, `.upsert()` allows you to perform the equivalent of\n`.insert()` if a row with the corresponding `onConflict` columns doesn't\nexist, or if it does exist, perform an alternative action depending on\n`ignoreDuplicates`.\n\nBy default, upserted rows are not returned. To return it, chain the call\nwith `.select()`.", "text": "- Primary keys must be included in `values` to use upsert.", "examples": [ { "id": "upsert-a-single-row-using-a-unique-key", "name": "Upsert a single row using a unique key", "code": "```ts\n// Upserting a single row, overwriting based on the 'username' unique column\nconst { data, error } = await supabase\n .from('users')\n .upsert({ username: 'supabot' }, { onConflict: 'username' })\n\n// Example response:\n// {\n// data: [\n// { id: 4, message: 'bar', username: 'supabot' }\n// ],\n// error: null\n// }\n```" }, { "id": "upsert-with-conflict-resolution-and-exact-row-counting", "name": "Upsert with conflict resolution and exact row counting", "code": "```ts\n// Upserting and returning exact count\nconst { data, error, count } = await supabase\n .from('users')\n .upsert(\n {\n id: 3,\n message: 'foo',\n username: 'supabot'\n },\n {\n onConflict: 'username',\n count: 'exact'\n }\n )\n\n// Example response:\n// {\n// data: [\n// {\n// id: 42,\n// handle: \"saoirse\",\n// display_name: \"Saoirse\"\n// }\n// ],\n// count: 1,\n// error: null\n// }\n```" }, { "id": "upsert-your-data", "name": "Upsert your data", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert({ id: 1, name: 'piano' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "handling-errors", "name": "Handling errors", "code": "```js\nconst { data, error } = await supabase.from('instruments').upsert({ id: 1, name: 'piano' }).select()\nif (error) console.error(error)\n```", "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT, UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." }, { "id": "bulk-upsert-your-data", "name": "Bulk Upsert your data", "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert([\n { id: 1, name: 'piano' },\n { id: 2, name: 'harp' },\n ])\n .select()\n```", "data": { "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n },\n {\n \"id\": 2,\n \"name\": \"harp\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" }, { "id": "upserting-into-tables-with-constraints", "name": "Upserting into tables with constraints", "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .upsert({ id: 42, handle: 'saoirse', display_name: 'Saoirse' })\n .select()\n```", "description": "In the following query, `upsert()` implicitly uses the `id`\n(primary key) column to determine conflicts. If there is no existing\nrow with the same `id`, `upsert()` inserts a new row, which\nwill fail in this case as there is already a row with `handle` `\"saoirse\"`.\nUsing the `onConflict` option, you can instruct `upsert()` to use\nanother column with a unique constraint to determine conflicts.", "data": { "sql": "```sql\ncreate table\n users (\n id int8 generated by default as identity primary key,\n handle text not null unique,\n display_name text\n );\n\ninsert into\n users (id, handle, display_name)\nvalues\n (1, 'saoirse', null);\n```" }, "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (handle)=(saoirse) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"users_handle_key\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.constructor": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.constructor", "params": [ { "name": "builder", "type": { "type": "object", "properties": [ { "name": "body", "type": { "type": "intrinsic", "name": "unknown" }, "isOptional": true }, { "name": "fetch", "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": "nameOnly", "name": "HeadersInit" } }, { "name": "isMaybeSingle", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "method", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "GET" }, { "type": "literal", "value": "POST" }, { "type": "literal", "value": "PATCH" }, { "type": "literal", "value": "DELETE" }, { "type": "literal", "value": "HEAD" } ] } }, { "name": "retry", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "shouldStripNulls", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "shouldThrowOnError", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "isOptional": true }, { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Creates a builder configured for a specific PostgREST request.", "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.from('users').select('*')\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.abortSignal": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.abortSignal", "params": [ { "name": "signal", "type": { "type": "nameOnly", "name": "AbortSignal" }, "comment": { "shortText": "The AbortSignal to use for the fetch request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set the AbortSignal for the fetch request.", "text": "You can use this to set a timeout for the request.", "examples": [ { "id": "aborting-requests-in-flight", "name": "Aborting requests in-flight", "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" }, { "id": "set-a-timeout", "name": "Set a timeout", "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.csv": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.csv", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a string in CSV format.", "examples": [ { "id": "return-data-as-csv", "name": "Return data as CSV", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.explain": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.explain", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "analyze", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" } }, { "name": "buffers", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on buffer usage" } }, { "name": "format", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "text" }, { "type": "literal", "value": "json" } ] }, "isOptional": true, "comment": { "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" } }, { "name": "settings", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on configuration\nparameters that affect query planning" } }, { "name": "verbose", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" } }, { "name": "wal", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If `true`, include information on WAL record generation" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "PostgrestBuilder" }, { "type": "nameOnly", "name": "PostgrestBuilder" } ] } }, "comment": { "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", "examples": [ { "id": "get-the-execution-plan", "name": "Get the execution plan", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" }, { "id": "get-the-execution-plan-with-analyze-and-verbose", "name": "Get the execution plan with analyze and verbose", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.geojson": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.geojson", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." } }, "@supabase/supabase-js.PostgrestTransformBuilder.limit": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.limit", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows to return" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by `rows`.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" }, { "id": "on-a-referenced-table", "name": "On a referenced table", "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\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');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.maxAffected": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.maxAffected", "params": [ { "name": "rows", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The maximum number of rows that can be affected" } } ], "comment": { "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." } }, "@supabase/supabase-js.PostgrestTransformBuilder.maybeSingle": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.maybeSingle", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.order": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.order", "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "altSignatures": [ { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "nameOnly", "name": "ColumnName" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "undefined" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } }, { "params": [ { "name": "column", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "ascending", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "nullsFirst", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "this" } } } ] }, "@supabase/supabase-js.PostgrestTransformBuilder.overrideTypes": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.overrideTypes", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Override the type of the returned `data` field in the response.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" }, { "id": "complete-override-type-of-successful-response", "name": "Complete Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", "response": "```ts\nlet x: typeof data // MyType[]\n```" }, { "id": "complete-override-type-of-object-response", "name": "Complete Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", "response": "```ts\nlet x: typeof data // MyType | null\n```" }, { "id": "partial-override-type-of-successful-response", "name": "Partial Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", "response": "```ts\nlet x: typeof data // Array\n```" }, { "id": "partial-override-type-of-object-response", "name": "Partial Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" }, { "id": "merge-vs-replace-existing-types", "name": "Merge vs replace existing types", "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.range": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.range", "params": [ { "name": "from", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The starting index from which to limit the result" } }, { "name": "to", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "The last index to which to limit the result" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "foreignTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Deprecated, use `options.referencedTable`\ninstead" } }, { "name": "referencedTable", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" } } ] }, "isOptional": true, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.retry": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.retry", "params": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "Whether to enable retries for this request" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.returns": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.returns", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "Override the type of the returned `data`.", "text": "- Deprecated: use overrideTypes method instead", "examples": [ { "id": "override-type-of-successful-response", "name": "Override type of successful response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", "response": "```js\nlet x: typeof data // MyType[]\n```" }, { "id": "override-type-of-object-response", "name": "Override type of object response", "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", "response": "```js\nlet x: typeof data // MyType | null\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.rollback": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.rollback", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", "examples": [ { "id": "validate-an-insert-without-persisting", "name": "Validate an insert without persisting", "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.select": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.select", "params": [ { "name": "columns", "type": { "type": "nameOnly", "name": "Query" }, "isOptional": true, "comment": { "shortText": "The columns to retrieve, separated by commas" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", "examples": [ { "id": "with-upsert", "name": "With `upsert()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.setHeader": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.setHeader", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header name" } }, { "name": "value", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "HTTP header value" } } ], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestTransformBuilder.single": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.single", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestBuilder" } }, "comment": { "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" }, "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.stripNulls": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.stripNulls", "params": [], "ret": { "type": { "type": "intrinsic", "name": "this" } }, "comment": { "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", "examples": [ { "id": "with-select", "name": "With `select()`", "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", "data": { "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" }, "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" } ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.then": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.then", "params": [ { "name": "onfulfilled", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "value" } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult1" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is resolved." } }, { "name": "onrejected", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "reason", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "union", "subTypes": [ { "type": "nameOnly", "name": "TResult2" }, { "type": "nameOnly", "name": "PromiseLike" } ] } } } ] }, "isOptional": true, "comment": { "shortText": "The callback to execute when the Promise is rejected." } } ], "ret": { "type": { "type": "nameOnly", "name": "PromiseLike" } }, "comment": { "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." } }, "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError", "params": [], "ret": { "type": { "type": "nameOnly", "name": "PostgrestTransformBuilder" } }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } }, "@supabase/supabase-js.RealtimeChannel.constructor": { "name": "@supabase/supabase-js.RealtimeChannel.constructor", "params": [ { "name": "topic", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Topic name can be any string." } }, { "name": "params", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "name": "RealtimeChannelOptions", "type": "object", "properties": [ { "name": "config", "type": { "type": "object", "properties": [ { "name": "broadcast", "type": { "type": "object", "properties": [ { "name": "ack", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "replay", "type": { "type": "nameOnly", "name": "ReplayOption" }, "isOptional": true }, { "name": "self", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" } }, { "name": "presence", "type": { "type": "object", "properties": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "key", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "key option is used to track presence payload across clients" } }, { "name": "private", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" } } ] } } ] } ] } }, { "name": "socket", "type": { "type": "nameOnly", "name": "RealtimeClient" } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.\n\nThe topic determines which realtime stream you are subscribing to. Config options let you\nenable acknowledgement for broadcasts, presence tracking, or private channels.", "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 channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nconst channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)\n```" } ] } }, "@supabase/supabase-js.RealtimeChannel.copyBindings": { "name": "@supabase/supabase-js.RealtimeChannel.copyBindings", "params": [ { "name": "other", "type": { "type": "nameOnly", "name": "RealtimeChannel" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "@supabase/supabase-js.RealtimeChannel.httpSend": { "name": "@supabase/supabase-js.RealtimeChannel.httpSend", "params": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the broadcast event" } }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" }, "comment": { "shortText": "Payload to be sent (required)" } }, { "name": "opts", "type": { "type": "object", "properties": [ { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Options including timeout" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "success", "type": { "type": "literal", "value": true } } ] }, { "type": "object", "properties": [ { "name": "error", "type": { "type": "intrinsic", "name": "string" } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" } }, { "name": "success", "type": { "type": "literal", "value": false } } ] } ] } } }, "comment": { "shortText": "Sends a broadcast message explicitly via REST API.\n\nThis method always uses the REST API endpoint regardless of WebSocket connection state.\nUseful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.\n\nPayloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as\n`application/octet-stream`; all other payloads are JSON-encoded." } }, "@supabase/supabase-js.RealtimeChannel.on": { "name": "@supabase/supabase-js.RealtimeChannel.on", "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "sync" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates an event handler that listens to changes." }, "altSignatures": [ { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "join" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "name": "RealtimePresenceJoinPayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": { "type": "intrinsic", "name": "string" } }, { "name": "newPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "leave" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "name": "RealtimePresenceLeavePayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": { "type": "intrinsic", "name": "string" } }, { "name": "leftPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "presence" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "subTypes": [ { "name": "RealtimePresenceJoinPayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": "[Circular]" }, { "name": "newPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] }, { "name": "RealtimePresenceLeavePayload", "type": "object", "properties": [ { "name": "currentPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } }, { "name": "event" }, { "name": "key", "type": "[Circular]" }, { "name": "leftPresences", "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } ] } ] }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "name": "RealtimePostgresChangesPayload", "subTypes": [ { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" }, { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" }, { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "INSERT" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "UPDATE" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "DELETE" }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "postgres_changes" } }, { "name": "filter", "type": { "name": "RealtimePostgresChangesFilter", "type": "object", "properties": [ { "name": "event", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "DELETE" }, { "type": "literal", "value": "*" }, { "type": "literal", "value": "INSERT" }, { "type": "literal", "value": "UPDATE" } ] }, "comment": { "shortText": "The type of database change to listen to." } }, { "name": "filter", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Receive database changes when filter is matched." } }, { "name": "schema", "type": "[Circular]", "comment": { "shortText": "The database schema to listen to." } }, { "name": "table", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The database table to listen to." } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "union", "name": "RealtimePostgresChangesPayload", "subTypes": [ { "type": "nameOnly", "name": "RealtimePostgresInsertPayload" }, { "type": "nameOnly", "name": "RealtimePostgresUpdatePayload" }, { "type": "nameOnly", "name": "RealtimePostgresDeletePayload" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" }, "comment": { "shortText": "One of \"broadcast\", \"presence\", or \"postgres_changes\"." } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } } ] }, "comment": { "shortText": "Custom object specific to the Realtime feature detailing which payloads to receive." } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "meta", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "replayed", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Function to be invoked when event handler is triggered." } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "meta", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "replayed", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true } ] }, "isOptional": true }, { "name": "payload", "type": { "type": "nameOnly", "name": "T" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "*", "name": "ALL" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastPayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "INSERT", "name": "INSERT" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastInsertPayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "UPDATE", "name": "UPDATE" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastUpdatePayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "broadcast" } }, { "name": "filter", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "literal", "value": "DELETE", "name": "DELETE" } } ] } }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "object", "properties": [ { "name": "event", "type": "[Circular]" }, { "name": "payload", "type": { "type": "nameOnly", "name": "RealtimeBroadcastDeletePayload" } }, { "name": "type", "type": { "type": "literal", "value": "broadcast" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } }, { "params": [ { "name": "type", "type": { "type": "literal", "value": "system" } }, { "name": "filter" }, { "name": "callback", "type": { "type": "function", "params": [ { "name": "payload", "type": { "type": "intrinsic", "name": "any" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } } } ] }, "@supabase/supabase-js.RealtimeChannel.presenceState": { "name": "@supabase/supabase-js.RealtimeChannel.presenceState", "params": [], "ret": { "type": { "name": "RealtimePresenceState", "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "array", "elemType": { "type": "nameOnly", "name": "Presence" } } } }, "comment": { "shortText": "Returns the current presence state for this channel.\n\nThe shape is a map keyed by presence key (for example a user id) where each entry contains the\ntracked metadata for that user." } }, "@supabase/supabase-js.RealtimeChannel.send": { "name": "@supabase/supabase-js.RealtimeChannel.send", "params": [ { "name": "args", "type": { "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the event being sent" } }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true, "comment": { "shortText": "Payload to be sent" } }, { "name": "type", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "broadcast" }, { "type": "literal", "value": "presence" }, { "type": "literal", "value": "postgres_changes" } ] }, "comment": { "shortText": "The type of event to send" } } ] }, "comment": { "shortText": "Arguments to send to channel" } }, { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Options to be used during the send process" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ { "type": "literal", "value": "ok" }, { "type": "literal", "value": "timed out" }, { "type": "literal", "value": "error" }, null ] } } }, "comment": { "shortText": "Sends a message into the channel.", "text": "- When using REST you don't need to subscribe to the channel\n- REST calls are only available from 2.37.0 onwards\n- If you create a channel only to send a REST broadcast, remove it from\n the client when the send completes", "examples": [ { "id": "send-a-message-via-websocket", "name": "Send a message via websocket", "code": "```js\nconst channel = supabase.channel('room1')\n\nchannel.subscribe((status) => {\n if (status === 'SUBSCRIBED') {\n channel.send({\n type: 'broadcast',\n event: 'cursor-pos',\n payload: { x: Math.random(), y: Math.random() },\n })\n }\n})\n```", "response": "```js\nok | timed out | error\n```" }, { "id": "send-a-message-via-rest", "name": "Send a message via REST", "code": "```js\nconst channel = supabase.channel('room1')\n\ntry {\n await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })\n} finally {\n await supabase.removeChannel(channel)\n}\n```" } ] } }, "@supabase/supabase-js.RealtimeChannel.subscribe": { "name": "@supabase/supabase-js.RealtimeChannel.subscribe", "params": [ { "name": "callback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "REALTIME_SUBSCRIBE_STATES" } }, { "name": "err", "type": { "type": "nameOnly", "name": "Error" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Subscribe registers your client with the server.\n\nThe optional `callback` receives a `status` and, on failure, an `err` argument.\nLog the full `err` so its `cause`, `name`, and any structured fields aren't hidden\nbehind `err.message`.", "examples": [ { "id": "handling-errors", "name": "Handling errors", "code": "```js\nsupabase.channel('room1').subscribe((status, err) => {\n if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {\n // Log the full error: its `cause` often holds the underlying reason.\n console.error(status, err)\n }\n})\n```" } ] } }, "@supabase/supabase-js.RealtimeChannel.teardown": { "name": "@supabase/supabase-js.RealtimeChannel.teardown", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Destroys and stops related timers." } }, "@supabase/supabase-js.RealtimeChannel.track": { "name": "@supabase/supabase-js.RealtimeChannel.track", "params": [ { "name": "payload", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } }, { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Sends the supplied payload to the presence tracker so other subscribers can see that this\nclient is online. Use `untrack` to stop broadcasting presence for the same key." } }, "@supabase/supabase-js.RealtimeChannel.unsubscribe": { "name": "@supabase/supabase-js.RealtimeChannel.unsubscribe", "params": [ { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Leaves the channel.\n\nUnsubscribes from server events, and instructs channel to terminate on server.\nTriggers onClose() hooks.\n\nTo receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:\nchannel.unsubscribe().receive(\"ok\", () => alert(\"left!\") )" } }, "@supabase/supabase-js.RealtimeChannel.untrack": { "name": "@supabase/supabase-js.RealtimeChannel.untrack", "params": [ { "name": "opts", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Removes the current presence state for this client." } }, "@supabase/supabase-js.RealtimeChannel.updateJoinPayload": { "name": "@supabase/supabase-js.RealtimeChannel.updateJoinPayload", "params": [ { "name": "payload", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Updates the payload that will be sent the next time the channel joins (reconnects).\nUseful for rotating access tokens or updating config without re-creating the channel." } }, "@supabase/supabase-js.RealtimeClient.constructor": { "name": "@supabase/supabase-js.RealtimeClient.constructor", "params": [ { "name": "endPoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The string WebSocket endpoint, ie, \"ws://example.com/socket\", \"wss://example.com\", \"/socket\" (inherited host & protocol)" } }, { "name": "options", "type": { "name": "RealtimeClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "literal", "value": null } ] } } } }, "isOptional": true }, { "name": "decode", "type": { "type": "nameOnly", "name": "Decode" }, "isOptional": true }, { "name": "disconnectOnEmptyChannelsAfterMs", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "encode", "type": { "type": "nameOnly", "name": "Encode" }, "isOptional": true }, { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true }, { "name": "headers", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true }, { "name": "heartbeatCallback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "HeartbeatStatus" } }, { "name": "latency", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "heartbeatIntervalMs", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "log_level", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "logger", "type": { "type": "function", "params": [ { "name": "kind", "type": { "type": "intrinsic", "name": "string" } }, { "name": "msg", "type": { "type": "intrinsic", "name": "string" } }, { "name": "data", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } } }, "isOptional": true }, { "name": "logLevel", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "params", "type": { "type": "index signature", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true }, { "name": "reconnectAfterMs", "type": { "type": "function", "params": [ { "name": "tries", "type": { "type": "intrinsic", "name": "number" } } ], "ret": { "type": { "type": "intrinsic", "name": "number" } } }, "isOptional": true }, { "name": "sessionStorage", "type": { "type": "nameOnly", "name": "Storage" }, "isOptional": true, "comment": { "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." } }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "transport", "type": { "type": "object", "name": "WebSocketLikeConstructor", "properties": [] }, "isOptional": true }, { "name": "vsn", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "worker", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true }, { "name": "workerUrl", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeClient" } }, "comment": { "shortText": "Initializes the Socket.", "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 channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" }, { "id": "standalone-import-for-bundle-sensitive-environments", "name": "Standalone import for bundle-sensitive environments", "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nclient.connect()\n```" } ] } }, "@supabase/supabase-js.RealtimeClient.channel": { "name": "@supabase/supabase-js.RealtimeClient.channel", "params": [ { "name": "topic", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "RealtimeChannelOptions", "type": "object", "properties": [ { "name": "config", "type": { "type": "object", "properties": [ { "name": "broadcast", "type": { "type": "object", "properties": [ { "name": "ack", "type": "[Circular]", "isOptional": true }, { "name": "replay", "type": { "type": "nameOnly", "name": "ReplayOption" }, "isOptional": true }, { "name": "self", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" } }, { "name": "presence", "type": { "type": "object", "properties": [ { "name": "enabled", "type": "[Circular]", "isOptional": true }, { "name": "key", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "key option is used to track presence payload across clients" } }, { "name": "private", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" } } ] } } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates (or reuses) a RealtimeChannel for the provided topic.\n\nTopics are automatically prefixed with `realtime:` to match the Realtime service.\nIf a channel with the same topic already exists it will be returned instead of creating\na duplicate connection." } }, "@supabase/supabase-js.RealtimeClient.connect": { "name": "@supabase/supabase-js.RealtimeClient.connect", "params": [], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Connects the socket, unless already connected." } }, "@supabase/supabase-js.RealtimeClient.connectionState": { "name": "@supabase/supabase-js.RealtimeClient.connectionState", "params": [], "ret": { "type": { "type": "nameOnly", "name": "ConnectionState" } }, "comment": { "shortText": "Returns the current state of the socket." } }, "@supabase/supabase-js.RealtimeClient.disconnect": { "name": "@supabase/supabase-js.RealtimeClient.disconnect", "params": [ { "name": "code", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "A numeric status code to send on disconnect." } }, { "name": "reason", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "A custom reason for the disconnect." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "literal", "value": "timeout" }, { "type": "literal", "value": "ok" } ] } } }, "comment": { "shortText": "Disconnects the socket." } }, "@supabase/supabase-js.RealtimeClient.endpointURL": { "name": "@supabase/supabase-js.RealtimeClient.endpointURL", "params": [], "ret": { "type": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Returns the URL of the websocket." } }, "@supabase/supabase-js.RealtimeClient.getChannels": { "name": "@supabase/supabase-js.RealtimeClient.getChannels", "params": [], "ret": { "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "RealtimeChannel" } } }, "comment": { "shortText": "Returns all created channels" } }, "@supabase/supabase-js.RealtimeClient.isConnected": { "name": "@supabase/supabase-js.RealtimeClient.isConnected", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` is the connection is open." } }, "@supabase/supabase-js.RealtimeClient.isConnecting": { "name": "@supabase/supabase-js.RealtimeClient.isConnecting", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` if the connection is currently connecting." } }, "@supabase/supabase-js.RealtimeClient.isDisconnecting": { "name": "@supabase/supabase-js.RealtimeClient.isDisconnecting", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Returns `true` if the connection is currently disconnecting." } }, "@supabase/supabase-js.RealtimeClient.log": { "name": "@supabase/supabase-js.RealtimeClient.log", "params": [ { "name": "kind", "type": { "type": "intrinsic", "name": "string" } }, { "name": "msg", "type": { "type": "intrinsic", "name": "string" } }, { "name": "data", "type": { "type": "intrinsic", "name": "any" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Logs the message.\n\nFor customized logging, `this.logger` can be overridden in Client constructor." } }, "@supabase/supabase-js.RealtimeClient.onHeartbeat": { "name": "@supabase/supabase-js.RealtimeClient.onHeartbeat", "params": [ { "name": "callback", "type": { "type": "nameOnly", "name": "HeartbeatCallback" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Sets a callback that receives lifecycle events for internal heartbeat messages.\nUseful for instrumenting connection health (e.g. sent/ok/timeout/disconnected)." } }, "@supabase/supabase-js.RealtimeClient.push": { "name": "@supabase/supabase-js.RealtimeClient.push", "params": [ { "name": "data", "type": { "name": "RealtimeMessage", "type": "object", "properties": [ { "name": "event", "type": { "type": "intrinsic", "name": "string" } }, { "name": "join_ref", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "payload", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ref", "type": { "type": "intrinsic", "name": "string" } }, { "name": "topic", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Push out a message if the socket is connected.\n\nIf the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established." } }, "@supabase/supabase-js.RealtimeClient.removeAllChannels": { "name": "@supabase/supabase-js.RealtimeClient.removeAllChannels", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "array", "elemType": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ { "type": "literal", "value": "ok" }, { "type": "literal", "value": "timed out" }, { "type": "literal", "value": "error" }, null ] } } } }, "comment": { "shortText": "Unsubscribes, removes and tears down all channels" } }, "@supabase/supabase-js.RealtimeClient.removeChannel": { "name": "@supabase/supabase-js.RealtimeClient.removeChannel", "params": [ { "name": "channel", "type": { "type": "nameOnly", "name": "RealtimeChannel" }, "comment": { "shortText": "A RealtimeChannel instance" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Unsubscribes, removes and tears down a single channel" } }, "@supabase/supabase-js.RealtimeClient.sendHeartbeat": { "name": "@supabase/supabase-js.RealtimeClient.sendHeartbeat", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Sends a heartbeat message if the socket is connected." } }, "@supabase/supabase-js.RealtimeClient.setAuth": { "name": "@supabase/supabase-js.RealtimeClient.setAuth", "params": [ { "name": "token", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "intrinsic", "name": "string" } ] }, "isOptional": true, "comment": { "shortText": "A JWT string to override the token set on the client." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "intrinsic", "name": "void" } } }, "comment": { "shortText": "Sets the JWT access token used for channel subscription authorization and Realtime RLS.\n\nIf param is null it will use the `accessToken` callback function or the token set on the client.\n\nOn callback used, it will set the value of the token internal to the client.\n\nWhen a token is explicitly provided, it will be preserved across channel operations\n(including removeChannel and resubscribe). The `accessToken` callback will not be\ninvoked until `setAuth()` is called without arguments.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nSetting the authorization header\n// Use a manual token (preserved across resubscribes, ignores accessToken callback)\nclient.realtime.setAuth('my-custom-jwt')\n\n// Switch back to using the accessToken callback\nclient.realtime.setAuth()\n```" } ] } }, "@supabase/supabase-js.RealtimePresence.constructor": { "name": "@supabase/supabase-js.RealtimePresence.constructor", "params": [ { "name": "channel", "type": { "type": "nameOnly", "name": "RealtimeChannel" }, "comment": { "shortText": "The realtime channel to bind to." } }, { "name": "opts", "type": { "type": "nameOnly", "name": "RealtimePresenceOptions" }, "isOptional": true, "comment": { "shortText": "Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`." } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimePresence" } }, "comment": { "shortText": "Creates a Presence helper that keeps the local presence state in sync with the server.", "examples": [ { "id": "example-for-a-presence-channel", "name": "Example for a presence channel", "code": "```ts\nconst presence = new RealtimePresence(channel)\n\nchannel.on('presence', ({ event, key }) => {\n console.log(`Presence ${event} on ${key}`)\n})\n```" } ] } }, "@supabase/supabase-js.StorageApiError.constructor": { "name": "@supabase/supabase-js.StorageApiError.constructor", "params": [ { "name": "message", "type": { "type": "intrinsic", "name": "string" } }, { "name": "status", "type": { "type": "intrinsic", "name": "number" } }, { "name": "statusCode", "type": { "type": "intrinsic", "name": "string" } }, { "name": "namespace", "type": { "type": "nameOnly", "name": "ErrorNamespace" }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "StorageApiError" } } }, "@supabase/supabase-js.StorageApiError.toJSON": { "name": "@supabase/supabase-js.StorageApiError.toJSON", "params": [], "ret": { "type": { "type": "object", "properties": [ { "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" } ] } }, { "name": "statusCode", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "undefined" }, { "type": "intrinsic", "name": "string" } ] } } ] } } }, "@supabase/supabase-js.SupabaseClient.constructor": { "name": "@supabase/supabase-js.SupabaseClient.constructor", "params": [ { "name": "supabaseUrl", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique Supabase URL which is supplied when you create a new project in your project dashboard." } }, { "name": "supabaseKey", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The unique Supabase Key which is supplied when you create a new project in your project dashboard." } }, { "name": "options", "type": { "name": "SupabaseClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "literal", "value": null } ] } } } }, "isOptional": true, "comment": { "shortText": "Optional function for using a third-party authentication system with\nSupabase. The function should return an access token or ID token (JWT) by\nobtaining it from the third-party auth SDK. Note that this\nfunction may be called concurrently and many times. Use memoization and\nlocking techniques if this is not supported by the SDKs.\n\nWhen set, the `auth` namespace of the Supabase client cannot be used.\nCreate another client if you wish to use Supabase Auth and third-party\nauthentications concurrently in the same application." } }, { "name": "auth", "type": { "type": "object", "properties": [ { "name": "autoRefreshToken", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Automatically refreshes the token for logged-in users. Defaults to true." } }, { "name": "debug", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['debug']" }, "isOptional": true, "comment": { "shortText": "If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library." } }, { "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": "Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.\n\nCan be set to a function to provide custom logic for determining if a URL contains\na Supabase auth callback. The function receives the current URL and parsed parameters,\nand should return true if the URL should be processed as a Supabase auth callback.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that\nalso return access_token in the URL fragment, which would otherwise be incorrectly\nintercepted by Supabase Auth.", "examples": [ { "id": "with-custom-detection-logic", "name": "With custom detection logic", "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": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['experimental']" }, "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": "flowType", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['flowType']" }, "isOptional": true, "comment": { "shortText": "OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications." } }, { "name": "lock", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['lock']" }, "isOptional": true, "comment": { "shortText": "Provide your own locking mechanism based on the environment. By default\nthe auth client coordinates refreshes itself and the server resolves\ncross-tab races. Passing a custom `lock` opts into a legacy path that\nwraps every auth operation in your supplied lock." } }, { "name": "lockAcquireTimeout", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['lockAcquireTimeout']" }, "isOptional": true, "comment": { "shortText": "Maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via `lock`. Only consulted when a custom `lock` is passed." } }, { "name": "persistSession", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to persist a logged-in session to storage. Defaults to true." } }, { "name": "skipAutoInitialize", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['skipAutoInitialize']" }, "isOptional": true, "comment": { "shortText": "If true, skips automatic initialization in the auth client constructor.\nUseful for SSR contexts where initialization timing must be controlled to\nprevent race conditions with HTTP response generation." } }, { "name": "storage", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['storage']" }, "isOptional": true, "comment": { "shortText": "A storage provider. Used to store the logged-in session." } }, { "name": "storageKey", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Optional key name used for storing tokens in local storage." } }, { "name": "throwOnError", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['throwOnError']" }, "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": "userStorage", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['userStorage']" }, "isOptional": true, "comment": { "shortText": "A storage provider to store the user profile separately from the session.\nUseful when you need to store the session information in cookies,\nwithout bloating the data with the redundant user object.", "tags": [ { "tag": "experimental", "text": "" } ] } } ] }, "isOptional": true }, { "name": "db", "type": { "type": "object", "properties": [ { "name": "schema", "type": { "type": "nameOnly", "name": "@supabase/supabase-js.default.SchemaName" }, "isOptional": true }, { "name": "timeout", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Optional timeout in milliseconds for PostgREST requests.\nWhen set, requests will automatically abort after this duration to prevent indefinite hangs.", "examples": [ { "id": "with-timeout", "name": "With timeout", "code": "```ts\nconst supabase = createClient(url, key, {\n db: { timeout: 30000 } // 30 second timeout\n})\n```" } ] } }, { "name": "urlLengthLimit", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true, "comment": { "shortText": "Maximum URL length in characters before warnings/errors are triggered.\nDefaults to 8000 characters. Used to provide helpful hints when URLs\nexceed server limits.", "examples": [ { "id": "with-custom-url-length-limit", "name": "With custom URL length limit", "code": "```ts\nconst supabase = createClient(url, key, {\n db: { urlLengthLimit: 10000 } // Custom limit\n})\n```" } ] } } ] }, "isOptional": true, "comment": { "shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`." } }, { "name": "global", "type": { "type": "object", "properties": [ { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true, "comment": { "shortText": "A custom `fetch` implementation." } }, { "name": "headers", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Optional headers for initializing the client." } } ] }, "isOptional": true }, { "name": "realtime", "type": { "name": "RealtimeClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] } } } }, "isOptional": true }, { "name": "decode", "type": { "type": "nameOnly", "name": "Decode" }, "isOptional": true }, { "name": "disconnectOnEmptyChannelsAfterMs", "type": "[Circular]", "isOptional": true }, { "name": "encode", "type": { "type": "nameOnly", "name": "Encode" }, "isOptional": true }, { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true }, { "name": "headers", "type": { "type": "index signature", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true }, { "name": "heartbeatCallback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "HeartbeatStatus" } }, { "name": "latency", "type": "[Circular]", "isOptional": true } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "heartbeatIntervalMs", "type": "[Circular]", "isOptional": true }, { "name": "log_level", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "logger", "type": { "type": "function", "params": [ { "name": "kind", "type": "[Circular]" }, { "name": "msg", "type": "[Circular]" }, { "name": "data", "type": "[Circular]", "isOptional": true } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "logLevel", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "params", "type": { "type": "index signature", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true }, { "name": "reconnectAfterMs", "type": { "type": "function", "params": [ { "name": "tries", "type": "[Circular]" } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "sessionStorage", "type": { "type": "nameOnly", "name": "Storage" }, "isOptional": true, "comment": { "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." } }, { "name": "timeout", "type": "[Circular]", "isOptional": true }, { "name": "transport", "type": { "type": "object", "name": "WebSocketLikeConstructor", "properties": [] }, "isOptional": true }, { "name": "vsn", "type": "[Circular]", "isOptional": true }, { "name": "worker", "type": "[Circular]", "isOptional": true }, { "name": "workerUrl", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Options passed to the realtime-js instance" } }, { "name": "storage", "type": { "type": "nameOnly", "name": "StorageClientOptions" }, "isOptional": true }, { "name": "tracePropagation", "type": { "type": "union", "subTypes": [ { "type": "object", "name": "TracePropagationOptions", "properties": [ { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Enable trace propagation. Disabled by default.\n\nWhen enabled, automatically detects and propagates active trace context\nfrom the OpenTelemetry API to outgoing Supabase requests. Trace context\nis only propagated to Supabase domains (`*.supabase.co`, `*.supabase.in`,\n`localhost`) for security — third-party hosts never receive trace headers.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true },\n})\n```" } ] } }, { "name": "respectSamplingDecision", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Respect upstream sampling decisions.\n\nWhen true (the default), trace context is not propagated if the upstream\ntrace indicates non-sampling (sampled flag = `0` in the `traceparent`\nheader). This avoids overhead when traces are being recorded but dropped.\n\nSet to `false` to always propagate, regardless of the sampling decision\n— useful when you want every Supabase request tagged with a `trace_id`\nfor log correlation, even if the trace itself will not be exported.", "examples": [ { "id": "always-propagate-ignore-sampling", "name": "Always propagate, ignore sampling", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" } ] } } ] }, { "type": "intrinsic", "name": "boolean" } ] }, "isOptional": true, "comment": { "shortText": "Enable OpenTelemetry / W3C trace context propagation to Supabase services.\n\nDisabled by default. Pass `true` for the common case (auto-detect an\nactive OpenTelemetry context and inject `traceparent` / `tracestate` /\n`baggage` headers) or an object for fine-grained control.\n\nRequires `@opentelemetry/api` to be installed in your application; if\nnot present, the SDK silently no-ops. Trace headers are only attached\nto requests targeting Supabase domains, so third-party hosts called\nthrough a custom `fetch` are never tagged.\n\nThe resulting `trace_id` appears in Supabase logs (API Gateway, Edge\nFunctions), letting you correlate client-side spans with server-side\nlog entries — including logs forwarded via Log Drains.", "examples": [ { "id": "shorthand-opt-in-with-defaults", "name": "Shorthand — opt in with defaults", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\n```" }, { "id": "with-an-active-opentelemetry-span", "name": "With an active OpenTelemetry span", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\nconst tracer = trace.getTracer('my-app')\n\nawait tracer.startActiveSpan('fetch-users', async (span) => {\n // Request carries the active trace context.\n const { data, error } = await supabase.from('users').select('*')\n span.end()\n})\n```" }, { "id": "advanced-always-propagate-even-for-non-sampled-traces", "name": "Advanced — always propagate, even for non-sampled traces", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" } ] } } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "SupabaseClient" } }, "comment": { "shortText": "Create a new client for use in the browser.", "examples": [ { "id": "creating-a-client", "name": "Creating a client", "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\n// Create a single supabase client for interacting with your database\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n```" }, { "id": "with-a-custom-domain", "name": "With a custom domain", "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\n// Use a custom domain as the supabase URL\nconst supabase = createClient('https://my-custom-domain.com', 'your-publishable-key')\n```" }, { "id": "with-additional-parameters", "name": "With additional parameters", "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst options = {\n db: {\n schema: 'public',\n },\n auth: {\n autoRefreshToken: true,\n persistSession: true,\n detectSessionInUrl: true\n },\n global: {\n headers: { 'x-my-custom-header': 'my-app-name' },\n },\n}\nconst supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", options)\n```" }, { "id": "with-custom-schemas", "name": "With custom schemas", "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n // Provide a custom schema. Defaults to \"public\".\n db: { schema: 'other_schema' }\n})\n```", "description": "By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.\nGo to [Settings > API > Exposed schemas](/dashboard/project/_/settings/api) and add the schema which you want to expose to the API.\n\nNote: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema." }, { "id": "custom-fetch-implementation", "name": "Custom fetch implementation", "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n global: { fetch: fetch.bind(globalThis) }\n})\n```", "description": "`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,\nbut an alternative `fetch` implementation can be provided as an option.\nThis is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers)." }, { "id": "react-native-options-with-asyncstorage", "name": "React Native options with AsyncStorage", "code": "```js\nimport 'react-native-url-polyfill/auto'\nimport { createClient } from '@supabase/supabase-js'\nimport AsyncStorage from \"@react-native-async-storage/async-storage\";\n\nconst supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", {\n auth: {\n storage: AsyncStorage,\n autoRefreshToken: true,\n persistSession: true,\n detectSessionInUrl: false,\n },\n});\n```", "description": "For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth." }, { "id": "react-native-options-with-expo-securestore", "name": "React Native options with Expo SecureStore", "code": "```ts\nimport 'react-native-url-polyfill/auto'\nimport { createClient } from '@supabase/supabase-js'\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport * as SecureStore from 'expo-secure-store';\nimport * as aesjs from 'aes-js';\nimport 'react-native-get-random-values';\n\n// As Expo's SecureStore does not support values larger than 2048\n// bytes, an AES-256 key is generated and stored in SecureStore, while\n// it is used to encrypt/decrypt values stored in AsyncStorage.\nclass LargeSecureStore {\n private async _encrypt(key: string, value: string) {\n const encryptionKey = crypto.getRandomValues(new Uint8Array(256 / 8));\n\n const cipher = new aesjs.ModeOfOperation.ctr(encryptionKey, new aesjs.Counter(1));\n const encryptedBytes = cipher.encrypt(aesjs.utils.utf8.toBytes(value));\n\n await SecureStore.setItemAsync(key, aesjs.utils.hex.fromBytes(encryptionKey));\n\n return aesjs.utils.hex.fromBytes(encryptedBytes);\n }\n\n private async _decrypt(key: string, value: string) {\n const encryptionKeyHex = await SecureStore.getItemAsync(key);\n if (!encryptionKeyHex) {\n return encryptionKeyHex;\n }\n\n const cipher = new aesjs.ModeOfOperation.ctr(aesjs.utils.hex.toBytes(encryptionKeyHex), new aesjs.Counter(1));\n const decryptedBytes = cipher.decrypt(aesjs.utils.hex.toBytes(value));\n\n return aesjs.utils.utf8.fromBytes(decryptedBytes);\n }\n\n async getItem(key: string) {\n const encrypted = await AsyncStorage.getItem(key);\n if (!encrypted) { return encrypted; }\n\n return await this._decrypt(key, encrypted);\n }\n\n async removeItem(key: string) {\n await AsyncStorage.removeItem(key);\n await SecureStore.deleteItemAsync(key);\n }\n\n async setItem(key: string, value: string) {\n const encrypted = await this._encrypt(key, value);\n\n await AsyncStorage.setItem(key, encrypted);\n }\n}\n\nconst supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", {\n auth: {\n storage: new LargeSecureStore(),\n autoRefreshToken: true,\n persistSession: true,\n detectSessionInUrl: false,\n },\n});\n```", "description": "If you wish to encrypt the user's session information, you can use `aes-js` and store the encryption key in Expo SecureStore.\nThe `aes-js` library, a reputable JavaScript-only implementation of the AES encryption algorithm in CTR mode.\nA new 256-bit encryption key is generated using the `react-native-get-random-values` library.\nThis key is stored inside Expo's SecureStore, while the value is encrypted and placed inside AsyncStorage.\n\nPlease make sure that:\n- You keep the `expo-secure-store`, `aes-js` and `react-native-get-random-values` libraries up-to-date.\n- Choose the correct [`SecureStoreOptions`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestoreoptions) for your app's needs.\n E.g. [`SecureStore.WHEN_UNLOCKED`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestorewhen_unlocked) regulates when the data can be accessed.\n- Carefully consider optimizations or other modifications to the above example, as those can lead to introducing subtle security vulnerabilities." }, { "id": "with-a-database-query", "name": "With a database query", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\nconst { data } = await supabase.from('profiles').select('*')\n```" }, { "id": "with-opentelemetry-tracing", "name": "With OpenTelemetry tracing", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n tracePropagation: true,\n})\n\nconst tracer = trace.getTracer('my-app')\n\nawait tracer.startActiveSpan('fetch-users', async (span) => {\n // Outgoing request carries the active trace context.\n const { data, error } = await supabase.from('users').select('*')\n span.end()\n})\n```", "description": "Opt in to W3C trace context propagation so the `trace_id` from your\nclient-side spans is attached to Supabase requests and appears in API\nGateway and Edge Function logs. Requires `@opentelemetry/api` to be\ninstalled in your application. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing)." } ] } }, "@supabase/supabase-js.SupabaseClient.channel": { "name": "@supabase/supabase-js.SupabaseClient.channel", "params": [ { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The name of the Realtime channel." } }, { "name": "opts", "type": { "name": "RealtimeChannelOptions", "type": "object", "properties": [ { "name": "config", "type": { "type": "object", "properties": [ { "name": "broadcast", "type": { "type": "object", "properties": [ { "name": "ack", "type": "[Circular]", "isOptional": true }, { "name": "replay", "type": { "type": "nameOnly", "name": "ReplayOption" }, "isOptional": true }, { "name": "self", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" } }, { "name": "presence", "type": { "type": "object", "properties": [ { "name": "enabled", "type": "[Circular]", "isOptional": true }, { "name": "key", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "key option is used to track presence payload across clients" } }, { "name": "private", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" } } ] } } ] }, "comment": { "shortText": "The options to pass to the Realtime channel." } } ], "ret": { "type": { "type": "nameOnly", "name": "RealtimeChannel" } }, "comment": { "shortText": "Creates a Realtime channel with Broadcast, Presence, and Postgres Changes." } }, "@supabase/supabase-js.SupabaseClient.from": { "name": "@supabase/supabase-js.SupabaseClient.from", "params": [ { "name": "relation", "type": { "type": "nameOnly", "name": "TableName" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } }, "comment": { "shortText": "Perform a query on a table or a view." }, "altSignatures": [ { "params": [ { "name": "relation", "type": { "type": "nameOnly", "name": "ViewName" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestQueryBuilder" } } } ] }, "@supabase/supabase-js.SupabaseClient.getChannels": { "name": "@supabase/supabase-js.SupabaseClient.getChannels", "params": [], "ret": { "type": { "type": "array", "elemType": { "type": "nameOnly", "name": "RealtimeChannel" } } }, "comment": { "shortText": "Returns all Realtime channels.", "examples": [ { "id": "get-all-channels", "name": "Get all channels", "code": "```js\nconst channels = supabase.getChannels()\n```" } ] } }, "@supabase/supabase-js.SupabaseClient.removeAllChannels": { "name": "@supabase/supabase-js.SupabaseClient.removeAllChannels", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "array", "elemType": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } } }, "comment": { "shortText": "Unsubscribes and removes all Realtime channels from Realtime client.", "text": "- Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.", "examples": [ { "id": "remove-all-channels", "name": "Remove all channels", "code": "```js\nsupabase.removeAllChannels()\n```" } ] } }, "@supabase/supabase-js.SupabaseClient.removeChannel": { "name": "@supabase/supabase-js.SupabaseClient.removeChannel", "params": [ { "name": "channel", "type": { "type": "nameOnly", "name": "RealtimeChannel" }, "comment": { "shortText": "The name of the Realtime channel." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ "[Circular]", "[Circular]", "[Circular]", null ] } } }, "comment": { "shortText": "Unsubscribes and removes Realtime channel from Realtime client.", "text": "- Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.", "examples": [ { "id": "removes-a-channel", "name": "Removes a channel", "code": "```js\nsupabase.removeChannel(myChannel)\n```" } ] } }, "@supabase/supabase-js.SupabaseClient.rpc": { "name": "@supabase/supabase-js.SupabaseClient.rpc", "params": [ { "name": "fn", "type": { "type": "nameOnly", "name": "FnName" }, "comment": { "shortText": "The function name to call" } }, { "name": "args", "type": { "type": "nameOnly", "name": "Args" }, "comment": { "shortText": "The arguments to pass to the function call" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "count", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": "exact" }, { "type": "literal", "value": "planned" }, { "type": "literal", "value": "estimated" } ] }, "isOptional": true, "comment": { "shortText": "Count algorithm to use to count rows returned by the\nfunction. Only applicable for [set-returning\nfunctions](https://www.postgresql.org/docs/current/functions-srf.html).\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." } }, { "name": "get", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, the function will be called with\nread-only access mode." } }, { "name": "head", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." } } ] }, "comment": { "shortText": "Named parameters" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestFilterBuilder" } }, "comment": { "shortText": "Perform a function call." } }, "@supabase/supabase-js.SupabaseClient.schema": { "name": "@supabase/supabase-js.SupabaseClient.schema", "params": [ { "name": "schema", "type": { "type": "nameOnly", "name": "DynamicSchema" }, "comment": { "shortText": "The schema to query" } } ], "ret": { "type": { "type": "nameOnly", "name": "PostgrestClient" } }, "comment": { "shortText": "Select a schema to query or perform an function (rpc) call.\n\nThe schema needs to be on the list of exposed schemas inside Supabase." } }, "@supabase/supabase-js.WebSocketFactory.getWebSocketConstructor": { "name": "@supabase/supabase-js.WebSocketFactory.getWebSocketConstructor", "params": [], "ret": { "type": { "type": "function", "params": [ { "name": "url", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "URL" } ] } }, { "name": "protocols", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "WebSocket" } } } }, "comment": { "shortText": "Returns the best available WebSocket constructor for the current runtime.", "examples": [ { "id": "example-with-error-handling", "name": "Example with error handling", "code": "```ts\ntry {\n const WS = WebSocketFactory.getWebSocketConstructor()\n const socket = new WS('wss://example.com/socket')\n} catch (error) {\n console.error('WebSocket not available in this environment.', error)\n}\n```" } ] } }, "@supabase/supabase-js.WebSocketFactory.isWebSocketSupported": { "name": "@supabase/supabase-js.WebSocketFactory.isWebSocketSupported", "params": [], "ret": { "type": { "type": "intrinsic", "name": "boolean" } }, "comment": { "shortText": "Detects whether the runtime can establish WebSocket connections.", "examples": [ { "id": "example-in-a-node-js-script", "name": "Example in a Node.js script", "code": "```ts\nif (!WebSocketFactory.isWebSocketSupported()) {\n console.error('WebSockets are required for this script.')\n process.exitCode = 1\n}\n```" } ] } }, "@supabase/supabase-js.AuthOAuthServerApi.approveAuthorization": { "name": "@supabase/supabase-js.AuthOAuthServerApi.approveAuthorization", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID to approve" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." } } ] }, "isOptional": true, "comment": { "shortText": "Optional parameters" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthConsentResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Approves an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter approval, the user's consent is stored and an authorization code is generated.\nThe response contains a complete redirect URL with the authorization code and state." } }, "@supabase/supabase-js.AuthOAuthServerApi.denyAuthorization": { "name": "@supabase/supabase-js.AuthOAuthServerApi.denyAuthorization", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID to deny" } }, { "name": "options", "type": { "type": "object", "properties": [ { "name": "skipBrowserRedirect", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." } } ] }, "isOptional": true, "comment": { "shortText": "Optional parameters" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthConsentResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": "[Circular]", "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Denies an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter denial, the response contains a redirect URL with an OAuth error\n(access_denied) to inform the OAuth client that the user rejected the request." } }, "@supabase/supabase-js.AuthOAuthServerApi.getAuthorizationDetails": { "name": "@supabase/supabase-js.AuthOAuthServerApi.getAuthorizationDetails", "params": [ { "name": "authorizationId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID from the authorization request" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthAuthorizationDetailsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "union", "subTypes": [ { "name": "OAuthAuthorizationDetails", "type": "object", "properties": [ { "name": "authorization_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The authorization ID used to approve or deny the request" } }, { "name": "client", "type": { "name": "OAuthAuthorizationClient", "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the OAuth client (UUID)" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URI of the OAuth client's website" } } ] }, "comment": { "shortText": "OAuth client requesting authorization" } }, { "name": "redirect_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The OAuth client's registered redirect URI (base URI without query parameters)" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Space-separated list of requested scopes (e.g., \"openid profile email\")" } }, { "name": "user", "type": { "type": "object", "properties": [ { "name": "email", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "User email" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "User ID (UUID)" } } ] }, "comment": { "shortText": "User object associated with the authorization" } } ] }, { "name": "OAuthRedirect", "type": "object", "properties": [ { "name": "redirect_url", "type": "[Circular]", "comment": { "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" } } ] } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Retrieves details about an OAuth authorization request.\nUsed to display consent information to the user.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis method returns one of two response types:\n- `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info\n- `OAuthRedirect`: User already consented - redirect immediately to the OAuth client\n\nUse type narrowing to distinguish between the responses:\n```typescript\nif ('authorization_id' in data) {\n // Show consent page\n} else {\n // Redirect to data.redirect_url\n}\n```" } }, "@supabase/supabase-js.AuthOAuthServerApi.listGrants": { "name": "@supabase/supabase-js.AuthOAuthServerApi.listGrants", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthGrantsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "OAuthGrant", "type": "object", "properties": [ { "name": "client", "type": { "name": "OAuthAuthorizationClient", "type": "object", "properties": [ { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client (UUID)" } }, { "name": "logo_uri", "type": "[Circular]", "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "uri", "type": "[Circular]", "comment": { "shortText": "URI of the OAuth client's website" } } ] }, "comment": { "shortText": "OAuth client information" } }, { "name": "granted_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the grant was created (ISO 8601 date-time)" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of scopes granted to this client" } } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all OAuth grants that the authenticated user has authorized.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth." } }, "@supabase/supabase-js.AuthOAuthServerApi.revokeGrant": { "name": "@supabase/supabase-js.AuthOAuthServerApi.revokeGrant", "params": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The OAuth client identifier (UUID) to revoke access for" } } ] }, "comment": { "shortText": "Revocation options" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthOAuthRevokeGrantResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Revokes a user's OAuth grant for a specific client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nRevocation marks consent as revoked, deletes active sessions for that OAuth client,\nand invalidates associated refresh tokens." } }, "@supabase/supabase-js.AuthPasskeyApi.delete": { "name": "@supabase/supabase-js.AuthPasskeyApi.delete", "params": [ { "name": "params", "type": { "name": "PasskeyDeleteParams", "type": "object", "properties": [ { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the passkey to delete" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyDeleteResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a passkey for the currently signed-in user." } }, "@supabase/supabase-js.AuthPasskeyApi.list": { "name": "@supabase/supabase-js.AuthPasskeyApi.list", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "PasskeyListItem", "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": "last_used_at", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all passkeys registered for the currently signed-in user." } }, "@supabase/supabase-js.AuthPasskeyApi.startAuthentication": { "name": "@supabase/supabase-js.AuthPasskeyApi.startAuthentication", "params": [ { "name": "params", "type": { "name": "StartPasskeyAuthenticationParams", "type": "object", "properties": [ { "name": "options", "type": { "type": "object", "properties": [ { "name": "captchaToken", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ] }, "isOptional": true } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyAuthenticationOptionsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyAuthenticationOptionsResponse", "type": "object", "properties": [ { "name": "challenge_id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "expires_at", "type": { "type": "intrinsic", "name": "number" } }, { "name": "options", "type": { "type": "nameOnly", "name": "ServerCredentialRequestOptions" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the passkey authentication ceremony. Fetches an authentication\nchallenge and credential request options from the server. Used as the\nfirst step of a two-step sign-in flow when the caller wants to handle\n`navigator.credentials.get()` themselves." } }, "@supabase/supabase-js.AuthPasskeyApi.startRegistration": { "name": "@supabase/supabase-js.AuthPasskeyApi.startRegistration", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyRegistrationOptionsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyRegistrationOptionsResponse", "type": "object", "properties": [ { "name": "challenge_id", "type": { "type": "intrinsic", "name": "string" } }, { "name": "expires_at", "type": { "type": "intrinsic", "name": "number" } }, { "name": "options", "type": { "type": "nameOnly", "name": "ServerCredentialCreationOptions" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the passkey registration ceremony. Fetches a registration challenge\nand credential creation options from the server. Used as the first step of\na two-step registration flow when the caller wants to handle\n`navigator.credentials.create()` themselves." } }, "@supabase/supabase-js.AuthPasskeyApi.update": { "name": "@supabase/supabase-js.AuthPasskeyApi.update", "params": [ { "name": "params", "type": { "name": "PasskeyUpdateParams", "type": "object", "properties": [ { "name": "friendlyName", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "New friendly name (max 120 chars)" } }, { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "UUID of the passkey to update" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyUpdateResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "PasskeyListItem", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "last_used_at", "type": "[Circular]", "isOptional": true } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates a passkey's friendly name." } }, "@supabase/supabase-js.AuthPasskeyApi.verifyAuthentication": { "name": "@supabase/supabase-js.AuthPasskeyApi.verifyAuthentication", "params": [ { "name": "params", "type": { "name": "VerifyPasskeyAuthenticationParams", "type": "object", "properties": [ { "name": "challengeId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Challenge ID from startAuthentication" } }, { "name": "credential", "type": { "type": "nameOnly", "name": "ServerCredentialResponse" }, "comment": { "shortText": "Serialized credential from navigator.credentials.get()" } } ] } } ], "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": "AuthSession", "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": "AuthUser", "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": "AuthUser", "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": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a passkey authentication credential against a previously issued\nchallenge. Used as the second step of a two-step sign-in flow." } }, "@supabase/supabase-js.AuthPasskeyApi.verifyRegistration": { "name": "@supabase/supabase-js.AuthPasskeyApi.verifyRegistration", "params": [ { "name": "params", "type": { "name": "VerifyPasskeyRegistrationParams", "type": "object", "properties": [ { "name": "challengeId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Challenge ID from startRegistration" } }, { "name": "credential", "type": { "type": "nameOnly", "name": "ServerCredentialResponse" }, "comment": { "shortText": "Serialized credential from navigator.credentials.create()" } } ] } } ], "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": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a passkey registration credential against a previously issued\nchallenge. Used as the second step of a two-step registration flow." } }, "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.createProvider": { "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.createProvider", "params": [ { "name": "params", "type": { "name": "CreateCustomProviderParams", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client ID" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client secret (write-only, not returned in responses)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "identifier", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ { "type": "literal", "value": "oauth2" }, { "type": "literal", "value": "oidc" } ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, { "type": "literal", "value": null } ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Creates a new custom OIDC/OAuth provider.\n\nFor OIDC providers, the server fetches and validates the OpenID Connect discovery document\nfrom the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.\nThis may return a validation error (`error_code: \"validation_failed\"`) if the discovery\ndocument is unreachable, not valid JSON, missing required fields, or if the issuer\nin the document does not match the expected issuer.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.deleteProvider": { "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.deleteProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } } ], "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": "Deletes a custom provider.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.getProvider": { "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.getProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Gets details of a specific custom provider by identifier.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.listProviders": { "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.listProviders", "params": [ { "name": "params", "type": { "name": "ListCustomProvidersParams", "type": "object", "properties": [ { "name": "type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Filter by provider type" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "providers", "type": { "type": "array", "elemType": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } } ] } }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "providers" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Lists all custom providers with optional type filter.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.updateProvider": { "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.updateProvider", "params": [ { "name": "identifier", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "UpdateCustomProviderParams", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "any" } }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth client ID" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth client secret (write-only, not returned in responses)" } }, { "name": "discovery_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "issuer", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "scopes", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": { "type": "intrinsic", "name": "boolean" }, "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "userinfo_url", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "CustomProviderResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "CustomOAuthProvider", "type": "object", "properties": [ { "name": "acceptable_client_ids", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional client IDs accepted during token validation" } }, { "name": "attribute_mapping", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Mapping of provider attributes to Supabase user attributes" } }, { "name": "authorization_params", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Additional parameters sent with the authorization request" } }, { "name": "authorization_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 authorization URL" } }, { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "OAuth client ID" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was created" } }, { "name": "discovery_document", "type": { "type": "union", "subTypes": [ { "name": "OIDCDiscoveryDocument", "type": "object", "properties": [ { "name": "authorization_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the authorization endpoint" } }, { "name": "issuer", "type": "[Circular]", "comment": { "shortText": "The issuer identifier" } }, { "name": "jwks_uri", "type": "[Circular]", "comment": { "shortText": "URL of the JSON Web Key Set" } }, { "name": "revocation_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the revocation endpoint" } }, { "name": "supported_id_token_signing_algs", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported ID token signing algorithms" } }, { "name": "supported_response_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported response types" } }, { "name": "supported_scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported scopes" } }, { "name": "supported_subject_types", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "List of supported subject types" } }, { "name": "token_endpoint", "type": "[Circular]", "comment": { "shortText": "URL of the token endpoint" } }, { "name": "userinfo_endpoint", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URL of the userinfo endpoint" } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "OIDC discovery document (OIDC providers only)" } }, { "name": "discovery_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC discovery URL" } }, { "name": "email_optional", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether email is optional for this provider" } }, { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether the provider is enabled" } }, { "name": "id", "type": "[Circular]", "comment": { "shortText": "Unique identifier (UUID)" } }, { "name": "identifier", "type": "[Circular]", "comment": { "shortText": "Provider identifier (e.g. `custom:mycompany`)" } }, { "name": "issuer", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OIDC issuer URL" } }, { "name": "jwks_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "JWKS URI for token verification" } }, { "name": "name", "type": "[Circular]", "comment": { "shortText": "Human-readable name" } }, { "name": "pkce_enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether PKCE is enabled" } }, { "name": "provider_type", "type": { "type": "union", "name": "CustomProviderType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Provider type" } }, { "name": "scopes", "type": { "type": "array", "elemType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "OAuth scopes requested during authorization" } }, { "name": "skip_nonce_check", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to skip nonce check (OIDC)" } }, { "name": "token_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 token URL" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the provider was last updated" } }, { "name": "userinfo_url", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "OAuth2 userinfo URL" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates an existing custom provider.\n\nWhen `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and\nvalidates the discovery document before persisting. This may return a validation error\n(`error_code: \"validation_failed\"`) if the discovery document is unreachable, invalid, or\nthe issuer does not match.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminMFAApi.deleteFactor": { "name": "@supabase/supabase-js.GoTrueAdminMFAApi.deleteFactor", "params": [ { "name": "params", "type": { "name": "AuthMFAAdminDeleteFactorParams", "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the MFA factor to delete." } }, { "name": "userId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the user whose factor is being deleted." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAAdminDeleteFactorResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor that was successfully deleted." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a factor on a user. This will log the user out of all active\nsessions if the deleted factor was verified.", "examples": [ { "id": "delete-a-factor-for-a-user", "name": "Delete a factor for a user", "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.deleteFactor({\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',\n})\n```", "response": "```json\n{\n data: {\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n },\n error: null\n}\n```" } ] } }, "@supabase/supabase-js.GoTrueAdminMFAApi.listFactors": { "name": "@supabase/supabase-js.GoTrueAdminMFAApi.listFactors", "params": [ { "name": "params", "type": { "name": "AuthMFAAdminListFactorsParams", "type": "object", "properties": [ { "name": "userId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the user." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAAdminListFactorsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "factors", "type": { "type": "array", "elemType": { "name": "Factor", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "factor_type", "type": { "type": "nameOnly", "name": "Type" }, "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": "nameOnly", "name": "Status" }, "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]" } ] } }, "comment": { "shortText": "All factors attached to the user." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all factors associated to a user.", "examples": [ { "id": "list-all-factors-for-a-user", "name": "List all factors for a user", "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.listFactors()\n```", "response": "```json\n{\n data: {\n factors: Factor[\n {\n id: '',\n friendly_name: 'Auth App Factor',\n factor_type: 'totp',\n status: 'verified',\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/supabase-js.GoTrueAdminOAuthApi.createClient": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.createClient", "params": [ { "name": "params", "type": { "name": "CreateOAuthClientParams", "type": "object", "properties": [ { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ { "type": "literal", "value": "authorization_code" }, { "type": "literal", "value": "refresh_token" }, null ] } }, "isOptional": true, "comment": { "shortText": "Array of allowed grant types (optional, defaults to authorization_code and refresh_token)" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "response_types", "type": { "type": "array", "elemType": { "type": "literal", "value": "code", "name": "OAuthClientResponseType" } }, "isOptional": true, "comment": { "shortText": "Array of allowed response types (optional, defaults to code)" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ { "type": "literal", "value": "none" }, { "type": "literal", "value": "client_secret_basic" }, { "type": "literal", "value": "client_secret_post" } ] }, "isOptional": true, "comment": { "shortText": "Token endpoint authentication method (defaults to server default if not specified)" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ { "type": "literal", "value": "public" }, { "type": "literal", "value": "confidential" } ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ { "type": "literal", "value": "dynamic" }, { "type": "literal", "value": "manual" } ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Creates a new OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminOAuthApi.deleteClient": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.deleteClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "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": "Deletes an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminOAuthApi.getClient": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.getClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Gets details of a specific OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminOAuthApi.listClients": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.listClients", "params": [ { "name": "params", "type": { "name": "PageParams", "type": "object", "properties": [ { "name": "page", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "The page number" } }, { "name": "perPage", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Number of items returned per page" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": { "type": "literal", "value": null } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "clients" } ] } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] } ] } } }, "comment": { "shortText": "Lists all OAuth clients with optional pagination.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminOAuthApi.regenerateClientSecret": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.regenerateClientSecret", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Regenerates the secret for an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminOAuthApi.updateClient": { "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.updateClient", "params": [ { "name": "clientId", "type": { "type": "intrinsic", "name": "string" } }, { "name": "params", "type": { "name": "UpdateOAuthClientParams", "type": "object", "properties": [ { "name": "client_name", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "isOptional": true, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } }, "isOptional": true, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Token endpoint authentication method" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "OAuthClientResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "OAuthClient", "type": "object", "properties": [ { "name": "client_id", "type": "[Circular]", "comment": { "shortText": "Unique identifier for the OAuth client" } }, { "name": "client_name", "type": "[Circular]", "comment": { "shortText": "Human-readable name of the OAuth client" } }, { "name": "client_secret", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Client secret (only returned on registration and regeneration)" } }, { "name": "client_type", "type": { "type": "union", "name": "OAuthClientType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Type of OAuth client" } }, { "name": "client_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client" } }, { "name": "created_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was created" } }, { "name": "grant_types", "type": { "type": "array", "elemType": { "type": "union", "name": "OAuthClientGrantType", "subTypes": [ "[Circular]", "[Circular]", null ] } }, "comment": { "shortText": "Array of allowed grant types" } }, { "name": "logo_uri", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "URI of the OAuth client's logo" } }, { "name": "redirect_uris", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed redirect URIs" } }, { "name": "registration_type", "type": { "type": "union", "name": "OAuthClientRegistrationType", "subTypes": [ "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Registration type of the client" } }, { "name": "response_types", "type": { "type": "array", "elemType": "[Circular]" }, "comment": { "shortText": "Array of allowed response types" } }, { "name": "scope", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Scope of the OAuth client" } }, { "name": "token_endpoint_auth_method", "type": { "type": "union", "name": "OAuthClientTokenEndpointAuthMethod", "subTypes": [ "[Circular]", "[Circular]", "[Circular]" ] }, "comment": { "shortText": "Token endpoint authentication method" } }, { "name": "updated_at", "type": "[Circular]", "comment": { "shortText": "Timestamp when the client was last updated" } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Updates an existing OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminPasskeyApi.deletePasskey": { "name": "@supabase/supabase-js.GoTrueAdminPasskeyApi.deletePasskey", "params": [ { "name": "params", "type": { "name": "AuthPasskeyAdminDeleteParams", "type": "object", "properties": [ { "name": "passkeyId", "type": { "type": "intrinsic", "name": "string" } }, { "name": "userId", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyDeleteResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Deletes a specific passkey for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueAdminPasskeyApi.listPasskeys": { "name": "@supabase/supabase-js.GoTrueAdminPasskeyApi.listPasskeys", "params": [ { "name": "params", "type": { "name": "AuthPasskeyAdminListParams", "type": "object", "properties": [ { "name": "userId", "type": { "type": "intrinsic", "name": "string" } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthPasskeyListResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { "name": "PasskeyListItem", "type": "object", "properties": [ { "name": "created_at", "type": "[Circular]" }, { "name": "friendly_name", "type": "[Circular]", "isOptional": true }, { "name": "id", "type": "[Circular]" }, { "name": "last_used_at", "type": "[Circular]", "isOptional": true } ] } } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Lists all passkeys registered for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." } }, "@supabase/supabase-js.GoTrueMFAApi.challenge": { "name": "@supabase/supabase-js.GoTrueMFAApi.challenge", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeParamsBase" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "AuthMFAChallengeResponseBase" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } }, "comment": { "shortText": "Prepares a challenge used to verify that a user has access to a MFA\nfactor.", "text": "- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.", "examples": [ { "id": "create-a-challenge-for-a-factor", "name": "Create a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n})\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'totp',\n expires_at: 1700000000\n },\n error: null\n}\n```" }, { "id": "create-a-challenge-for-a-phone-factor", "name": "Create a challenge for a phone factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n expires_at: 1700000000\n },\n error: null\n}\n```" }, { "id": "create-a-challenge-for-a-phone-factor-whatsapp", "name": "Create a challenge for a phone factor (WhatsApp)", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n channel: 'whatsapp',\n})\n```", "response": "```json\n{\n data: {\n id: '',\n expires_at: 1700000000\n },\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengePhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data", "type": { "type": "nameOnly", "name": "AuthMFAChallengeResponseBase" } }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeWebauthnParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "literal", "value": null } }, { "name": "error", "type": { "type": "nameOnly", "name": "AuthError" } } ] }, { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": { "type": "literal", "value": null } } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAChallengeParams", "subTypes": [ { "type": "nameOnly", "name": "MFAChallengeTOTPParams" }, { "type": "nameOnly", "name": "MFAChallengePhoneParams" }, { "type": "nameOnly", "name": "MFAChallengeWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAChallengeResponse", "subTypes": [ { "type": "union", "name": "AuthMFAChallengeTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAChallengePhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAChallengeWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } ] } } } } ] }, "@supabase/supabase-js.GoTrueMFAApi.challengeAndVerify": { "name": "@supabase/supabase-js.GoTrueMFAApi.challengeAndVerify", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAChallengeAndVerifyTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": { "type": "intrinsic", "name": "number" }, "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": { "type": "literal", "value": "bearer" }, "comment": { "shortText": "Type of token, always `bearer`." } }, { "name": "user", "type": { "type": "object", "name": "AuthUser", "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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", "text": "- Intended for use with only TOTP factors.\n- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.\n- Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.", "examples": [ { "id": "create-and-verify-a-challenge-for-a-factor", "name": "Create and verify a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.challengeAndVerify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n code: '123456'\n})\n```", "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 ]\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\": \"example@email.com\",\n \"email_verified\": true,\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@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\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/supabase-js.GoTrueMFAApi.enroll": { "name": "@supabase/supabase-js.GoTrueMFAApi.enroll", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Starts the enrollment process for a new Multi-Factor Authentication (MFA)\nfactor. This method creates a new `unverified` factor.\nTo verify a factor, present the QR code or secret to the user and ask them to add it to their\nauthenticator app.\nThe user has to enter the code from their authenticator app to verify it.\n\nUpon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.", "text": "- Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.\n- To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).\n- To generate a QR code for the `totp` secret in Next.js, you can do the following:\n```html\n{data.totp.uri}\n```\n- The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.", "examples": [ { "id": "enroll-a-time-based-one-time-password-totp-factor", "name": "Enroll a time-based, one-time password (TOTP) factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'totp',\n friendlyName: 'your_friendly_name'\n})\n\n// Use the id to create a challenge.\n// The challenge can be verified by entering the code generated from the authenticator app.\n// The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.\nconst { id, type, totp: { qr_code, secret, uri }, friendly_name } = data\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'totp'\n totp: {\n qr_code: '',\n secret: '',\n uri: '',\n }\n friendly_name?: 'Important app'\n },\n error: null\n}\n```" }, { "id": "enroll-a-phone-factor", "name": "Enroll a Phone Factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'phone',\n friendlyName: 'your_friendly_name',\n phone: '+12345678',\n})\n\n// Use the id to create a challenge and send an SMS with a code to the user.\nconst { id, type, friendly_name, phone } = data\n\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n friendly_name?: 'Important app',\n phone: '+5787123456'\n },\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollPhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollPhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAEnrollParamsBase" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAEnrollParams", "subTypes": [ { "type": "nameOnly", "name": "MFAEnrollTOTPParams" }, { "type": "nameOnly", "name": "MFAEnrollPhoneParams" }, { "type": "nameOnly", "name": "MFAEnrollWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAEnrollResponse", "subTypes": [ { "type": "union", "name": "AuthMFAEnrollTOTPResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAEnrollPhoneResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] }, { "type": "union", "name": "AuthMFAEnrollWebauthnResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } ] } } } } ] }, "@supabase/supabase-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": { "name": "@supabase/supabase-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel", "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": "AuthMFAGetAuthenticatorAssuranceLevelResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "currentAuthenticationMethods", "type": { "type": "union", "subTypes": [ { "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": "[Circular]", "comment": { "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." } } ] } }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "comment": { "shortText": "A list of all authentication methods attached to this session. Use\nthe information here to detect the last time a user verified a\nfactor, for example if implementing a step-up scenario.\n\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": "currentLevel", "type": { "type": "union", "subTypes": [ { "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ "[Circular]", "[Circular]", null ] }, { "type": "literal", "value": null } ] }, "comment": { "shortText": "Current AAL level of the session." } }, { "name": "nextLevel", "type": { "type": "union", "subTypes": [ { "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ "[Circular]", "[Circular]", null ] }, { "type": "literal", "value": null } ] }, "comment": { "shortText": "Next possible AAL level for the session. If the next level is higher\nthan the current one, the user should go through MFA." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Returns the Authenticator Assurance Level (AAL) for the active session.\n\n- `aal1` (or `null`) means that the user's identity has been verified only\nwith a conventional login (email+password, OTP, magic link, social login,\netc.).\n- `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.\n\nWhen called without a JWT parameter, this method is fairly quick (microseconds)\nand rarely uses the network. When a JWT is provided (useful in server-side\nenvironments like Edge Functions where no session is stored), this method\nwill make a network request to validate the user and fetch their MFA factors.", "text": "- Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.\n- In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.\n- If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.\n- An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.", "examples": [ { "id": "get-the-aal-details-of-a-session", "name": "Get the AAL details of a session", "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()\nconst { currentLevel, nextLevel, currentAuthenticationMethods } = data\n```", "response": "```json\n{\n data: {\n currentLevel: 'aal1',\n nextLevel: 'aal2',\n currentAuthenticationMethods: [\n {\n method: 'password',\n timestamp: 1700000000\n }\n ]\n }\n error: null\n}\n```" }, { "id": "get-the-aal-details-for-a-specific-jwt", "name": "Get the AAL details for a specific JWT", "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)\n```" } ] } }, "@supabase/supabase-js.GoTrueMFAApi.listFactors": { "name": "@supabase/supabase-js.GoTrueMFAApi.listFactors", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAListFactorsResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data" }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Returns the list of MFA factors enabled for this user." } }, "@supabase/supabase-js.GoTrueMFAApi.unenroll": { "name": "@supabase/supabase-js.GoTrueMFAApi.unenroll", "params": [ { "name": "params", "type": { "name": "MFAUnenrollParams", "type": "object", "properties": [ { "name": "factorId", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor being unenrolled." } } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAUnenrollResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "type": "object", "properties": [ { "name": "id", "type": { "type": "intrinsic", "name": "string" }, "comment": { "shortText": "ID of the factor that was successfully unenrolled." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Unenroll removes a MFA factor.\nA user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.", "examples": [ { "id": "unenroll-a-factor", "name": "Unenroll a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.unenroll({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", "response": "```json\n{\n data: {\n id: ''\n },\n error: null\n}\n```" } ] } }, "@supabase/supabase-js.GoTrueMFAApi.verify": { "name": "@supabase/supabase-js.GoTrueMFAApi.verify", "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyTOTPParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `bearer`." } }, { "name": "user", "type": { "type": "object", "name": "AuthUser", "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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } }, "comment": { "shortText": "Verifies a code against a challenge. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", "text": "- To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.", "examples": [ { "id": "verify-a-challenge-for-a-factor", "name": "Verify a challenge for a factor", "code": "```js\nconst { data, error } = await supabase.auth.mfa.verify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',\n code: '123456'\n})\n```", "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\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 ]\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\": \"example@email.com\",\n \"email_verified\": true,\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@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" } ] }, "altSignatures": [ { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyPhoneParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `bearer`." } }, { "name": "user", "type": { "type": "object", "name": "AuthUser", "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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "nameOnly", "name": "MFAVerifyWebauthnParams" } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `bearer`." } }, { "name": "user", "type": { "type": "object", "name": "AuthUser", "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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } }, { "params": [ { "name": "params", "type": { "type": "union", "name": "MFAVerifyParams", "subTypes": [ { "type": "nameOnly", "name": "MFAVerifyTOTPParams" }, { "type": "nameOnly", "name": "MFAVerifyPhoneParams" }, { "type": "nameOnly", "name": "MFAVerifyWebauthnParams" } ] } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { "type": "object", "properties": [ { "name": "data", "type": { "name": "AuthMFAVerifyResponseData", "type": "object", "properties": [ { "name": "access_token", "type": "[Circular]", "comment": { "shortText": "New access token (JWT) after successful verification." } }, { "name": "expires_in", "type": "[Circular]", "comment": { "shortText": "Number of seconds in which the access token will expire." } }, { "name": "refresh_token", "type": "[Circular]", "comment": { "shortText": "Refresh token you can use to obtain new access tokens when expired." } }, { "name": "token_type", "type": "[Circular]", "comment": { "shortText": "Type of token, always `bearer`." } }, { "name": "user", "type": { "type": "object", "name": "AuthUser", "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": "Updated user profile." } } ] } }, { "name": "error", "type": "[Circular]" } ] }, { "type": "object", "properties": [ { "name": "data", "type": "[Circular]" }, { "name": "error" } ] } ] } } } } ] }, "@supabase/supabase-js.WebSocketLike.addEventListener": { "name": "@supabase/supabase-js.WebSocketLike.addEventListener", "params": [ { "name": "type", "type": { "type": "intrinsic", "name": "string" } }, { "name": "listener", "type": { "type": "nameOnly", "name": "EventListener" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Registers an event listener on the socket (compatible with browser WebSocket API)." } }, "@supabase/supabase-js.WebSocketLike.close": { "name": "@supabase/supabase-js.WebSocketLike.close", "params": [ { "name": "code", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "reason", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Closes the socket, optionally providing a close code and reason." } }, "@supabase/supabase-js.WebSocketLike.removeEventListener": { "name": "@supabase/supabase-js.WebSocketLike.removeEventListener", "params": [ { "name": "type", "type": { "type": "intrinsic", "name": "string" } }, { "name": "listener", "type": { "type": "nameOnly", "name": "EventListener" } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Removes a previously registered event listener." } }, "@supabase/supabase-js.WebSocketLike.send": { "name": "@supabase/supabase-js.WebSocketLike.send", "params": [ { "name": "data", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "ArrayBufferLike" }, { "type": "nameOnly", "name": "ArrayBufferView" }, { "type": "nameOnly", "name": "Blob" } ] } } ], "ret": { "type": { "type": "intrinsic", "name": "void" } }, "comment": { "shortText": "Sends data through the socket using the underlying implementation." } }, "@supabase/supabase-js.WebSocketLikeConstructor.constructor": { "name": "@supabase/supabase-js.WebSocketLikeConstructor.constructor", "params": [ { "name": "address", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "nameOnly", "name": "URL" } ] } }, { "name": "subprotocols", "type": { "type": "union", "subTypes": [ { "type": "intrinsic", "name": "string" }, { "type": "array", "elemType": { "type": "intrinsic", "name": "string" } } ] }, "isOptional": true } ], "ret": { "type": { "type": "object", "name": "WebSocketLike", "properties": [ { "name": "binaryType", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "bufferedAmount", "type": { "type": "intrinsic", "name": "number" }, "isOptional": true }, { "name": "CLOSED", "type": { "type": "intrinsic", "name": "number" } }, { "name": "CLOSING", "type": { "type": "intrinsic", "name": "number" } }, { "name": "CONNECTING", "type": { "type": "intrinsic", "name": "number" } }, { "name": "dispatchEvent", "type": { "type": "function", "params": [ { "name": "event", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "boolean" } } }, "isOptional": true }, { "name": "extensions", "type": { "type": "intrinsic", "name": "string" }, "isOptional": true }, { "name": "onclose", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "CloseEvent" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onerror", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onmessage", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "MessageEvent" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "onopen", "type": { "type": "union", "subTypes": [ { "type": "literal", "value": null }, { "type": "function", "params": [ { "name": "this", "type": { "type": "intrinsic", "name": "any" } }, { "name": "ev", "type": { "type": "nameOnly", "name": "Event" } } ], "ret": { "type": { "type": "intrinsic", "name": "any" } } } ] } }, { "name": "OPEN", "type": { "type": "intrinsic", "name": "number" } }, { "name": "protocol", "type": { "type": "intrinsic", "name": "string" } }, { "name": "readyState", "type": { "type": "intrinsic", "name": "number" } }, { "name": "url", "type": { "type": "intrinsic", "name": "string" } } ] } } }, "@supabase/supabase-js.createClient": { "name": "@supabase/supabase-js.createClient", "params": [ { "name": "supabaseUrl", "type": { "type": "intrinsic", "name": "string" } }, { "name": "supabaseKey", "type": { "type": "intrinsic", "name": "string" } }, { "name": "options", "type": { "name": "SupabaseClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] } } } }, "isOptional": true, "comment": { "shortText": "Optional function for using a third-party authentication system with\nSupabase. The function should return an access token or ID token (JWT) by\nobtaining it from the third-party auth SDK. Note that this\nfunction may be called concurrently and many times. Use memoization and\nlocking techniques if this is not supported by the SDKs.\n\nWhen set, the `auth` namespace of the Supabase client cannot be used.\nCreate another client if you wish to use Supabase Auth and third-party\nauthentications concurrently in the same application." } }, { "name": "auth", "type": { "type": "object", "properties": [ { "name": "autoRefreshToken", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Automatically refreshes the token for logged-in users. Defaults to true." } }, { "name": "debug", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['debug']" }, "isOptional": true, "comment": { "shortText": "If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library." } }, { "name": "detectSessionInUrl", "type": { "type": "union", "subTypes": [ "[Circular]", { "type": "function", "params": [ { "name": "url", "type": { "type": "nameOnly", "name": "URL" } }, { "name": "params", "type": { "type": "index signature", "keyType": "[Circular]", "valueType": "[Circular]" } } ], "ret": { "type": "[Circular]" } } ] }, "isOptional": true, "comment": { "shortText": "Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.\n\nCan be set to a function to provide custom logic for determining if a URL contains\na Supabase auth callback. The function receives the current URL and parsed parameters,\nand should return true if the URL should be processed as a Supabase auth callback.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that\nalso return access_token in the URL fragment, which would otherwise be incorrectly\nintercepted by Supabase Auth.", "examples": [ { "id": "with-custom-detection-logic", "name": "With custom detection logic", "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": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['experimental']" }, "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": "flowType", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['flowType']" }, "isOptional": true, "comment": { "shortText": "OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications." } }, { "name": "lock", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['lock']" }, "isOptional": true, "comment": { "shortText": "Provide your own locking mechanism based on the environment. By default\nthe auth client coordinates refreshes itself and the server resolves\ncross-tab races. Passing a custom `lock` opts into a legacy path that\nwraps every auth operation in your supplied lock." } }, { "name": "lockAcquireTimeout", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['lockAcquireTimeout']" }, "isOptional": true, "comment": { "shortText": "Maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via `lock`. Only consulted when a custom `lock` is passed." } }, { "name": "persistSession", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Whether to persist a logged-in session to storage. Defaults to true." } }, { "name": "skipAutoInitialize", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['skipAutoInitialize']" }, "isOptional": true, "comment": { "shortText": "If true, skips automatic initialization in the auth client constructor.\nUseful for SSR contexts where initialization timing must be controlled to\nprevent race conditions with HTTP response generation." } }, { "name": "storage", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['storage']" }, "isOptional": true, "comment": { "shortText": "A storage provider. Used to store the logged-in session." } }, { "name": "storageKey", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Optional key name used for storing tokens in local storage." } }, { "name": "throwOnError", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['throwOnError']" }, "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": "userStorage", "type": { "type": "nameOnly", "name": "SupabaseAuthClientOptions['userStorage']" }, "isOptional": true, "comment": { "shortText": "A storage provider to store the user profile separately from the session.\nUseful when you need to store the session information in cookies,\nwithout bloating the data with the redundant user object.", "tags": [ { "tag": "experimental", "text": "" } ] } } ] }, "isOptional": true }, { "name": "db", "type": { "type": "object", "properties": [ { "name": "schema", "type": { "type": "nameOnly", "name": "SchemaName" }, "isOptional": true }, { "name": "timeout", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Optional timeout in milliseconds for PostgREST requests.\nWhen set, requests will automatically abort after this duration to prevent indefinite hangs.", "examples": [ { "id": "with-timeout", "name": "With timeout", "code": "```ts\nconst supabase = createClient(url, key, {\n db: { timeout: 30000 } // 30 second timeout\n})\n```" } ] } }, { "name": "urlLengthLimit", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Maximum URL length in characters before warnings/errors are triggered.\nDefaults to 8000 characters. Used to provide helpful hints when URLs\nexceed server limits.", "examples": [ { "id": "with-custom-url-length-limit", "name": "With custom URL length limit", "code": "```ts\nconst supabase = createClient(url, key, {\n db: { urlLengthLimit: 10000 } // Custom limit\n})\n```" } ] } } ] }, "isOptional": true, "comment": { "shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`." } }, { "name": "global", "type": { "type": "object", "properties": [ { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true, "comment": { "shortText": "A custom `fetch` implementation." } }, { "name": "headers", "type": { "type": "record", "name": "Record", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true, "comment": { "shortText": "Optional headers for initializing the client." } } ] }, "isOptional": true }, { "name": "realtime", "type": { "name": "RealtimeClientOptions", "type": "object", "properties": [ { "name": "accessToken", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "union", "subTypes": [ "[Circular]", "[Circular]" ] } } } }, "isOptional": true }, { "name": "decode", "type": { "type": "nameOnly", "name": "Decode" }, "isOptional": true }, { "name": "disconnectOnEmptyChannelsAfterMs", "type": "[Circular]", "isOptional": true }, { "name": "encode", "type": { "type": "nameOnly", "name": "Encode" }, "isOptional": true }, { "name": "fetch", "type": { "type": "nameOnly", "name": "Fetch" }, "isOptional": true }, { "name": "headers", "type": { "type": "index signature", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true }, { "name": "heartbeatCallback", "type": { "type": "function", "params": [ { "name": "status", "type": { "type": "nameOnly", "name": "HeartbeatStatus" } }, { "name": "latency", "type": "[Circular]", "isOptional": true } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "heartbeatIntervalMs", "type": "[Circular]", "isOptional": true }, { "name": "log_level", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "logger", "type": { "type": "function", "params": [ { "name": "kind", "type": "[Circular]" }, { "name": "msg", "type": "[Circular]" }, { "name": "data", "type": "[Circular]", "isOptional": true } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "logLevel", "type": { "type": "nameOnly", "name": "LogLevel" }, "isOptional": true }, { "name": "params", "type": { "type": "index signature", "keyType": "[Circular]", "valueType": "[Circular]" }, "isOptional": true }, { "name": "reconnectAfterMs", "type": { "type": "function", "params": [ { "name": "tries", "type": "[Circular]" } ], "ret": { "type": "[Circular]" } }, "isOptional": true }, { "name": "sessionStorage", "type": { "type": "nameOnly", "name": "Storage" }, "isOptional": true, "comment": { "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." } }, { "name": "timeout", "type": "[Circular]", "isOptional": true }, { "name": "transport", "type": { "type": "object", "name": "WebSocketLikeConstructor", "properties": [] }, "isOptional": true }, { "name": "vsn", "type": "[Circular]", "isOptional": true }, { "name": "worker", "type": "[Circular]", "isOptional": true }, { "name": "workerUrl", "type": "[Circular]", "isOptional": true } ] }, "isOptional": true, "comment": { "shortText": "Options passed to the realtime-js instance" } }, { "name": "storage", "type": { "type": "nameOnly", "name": "StorageClientOptions" }, "isOptional": true }, { "name": "tracePropagation", "type": { "type": "union", "subTypes": [ { "type": "object", "name": "TracePropagationOptions", "properties": [ { "name": "enabled", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Enable trace propagation. Disabled by default.\n\nWhen enabled, automatically detects and propagates active trace context\nfrom the OpenTelemetry API to outgoing Supabase requests. Trace context\nis only propagated to Supabase domains (`*.supabase.co`, `*.supabase.in`,\n`localhost`) for security — third-party hosts never receive trace headers.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true },\n})\n```" } ] } }, { "name": "respectSamplingDecision", "type": "[Circular]", "isOptional": true, "comment": { "shortText": "Respect upstream sampling decisions.\n\nWhen true (the default), trace context is not propagated if the upstream\ntrace indicates non-sampling (sampled flag = `0` in the `traceparent`\nheader). This avoids overhead when traces are being recorded but dropped.\n\nSet to `false` to always propagate, regardless of the sampling decision\n— useful when you want every Supabase request tagged with a `trace_id`\nfor log correlation, even if the trace itself will not be exported.", "examples": [ { "id": "always-propagate-ignore-sampling", "name": "Always propagate, ignore sampling", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" } ] } } ] }, "[Circular]" ] }, "isOptional": true, "comment": { "shortText": "Enable OpenTelemetry / W3C trace context propagation to Supabase services.\n\nDisabled by default. Pass `true` for the common case (auto-detect an\nactive OpenTelemetry context and inject `traceparent` / `tracestate` /\n`baggage` headers) or an object for fine-grained control.\n\nRequires `@opentelemetry/api` to be installed in your application; if\nnot present, the SDK silently no-ops. Trace headers are only attached\nto requests targeting Supabase domains, so third-party hosts called\nthrough a custom `fetch` are never tagged.\n\nThe resulting `trace_id` appears in Supabase logs (API Gateway, Edge\nFunctions), letting you correlate client-side spans with server-side\nlog entries — including logs forwarded via Log Drains.", "examples": [ { "id": "shorthand-opt-in-with-defaults", "name": "Shorthand — opt in with defaults", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\n```" }, { "id": "with-an-active-opentelemetry-span", "name": "With an active OpenTelemetry span", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\nconst tracer = trace.getTracer('my-app')\n\nawait tracer.startActiveSpan('fetch-users', async (span) => {\n // Request carries the active trace context.\n const { data, error } = await supabase.from('users').select('*')\n span.end()\n})\n```" }, { "id": "advanced-always-propagate-even-for-non-sampled-traces", "name": "Advanced — always propagate, even for non-sampled traces", "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" } ] } } ] }, "isOptional": true } ], "ret": { "type": { "type": "nameOnly", "name": "SupabaseClient" } }, "comment": { "shortText": "Creates a new Supabase Client.", "examples": [ { "id": "creating-a-supabase-client", "name": "Creating a Supabase client", "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('profiles').select('*')\n```" } ] } }, "@supabase/supabase-js.isAuthApiError": { "name": "@supabase/supabase-js.isAuthApiError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.isAuthError": { "name": "@supabase/supabase-js.isAuthError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.isAuthImplicitGrantRedirectError": { "name": "@supabase/supabase-js.isAuthImplicitGrantRedirectError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "any" } } ] }, "@supabase/supabase-js.isAuthPKCECodeVerifierMissingError": { "name": "@supabase/supabase-js.isAuthPKCECodeVerifierMissingError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.isAuthRefreshDiscardedError": { "name": "@supabase/supabase-js.isAuthRefreshDiscardedError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.isAuthRetryableFetchError": { "name": "@supabase/supabase-js.isAuthRetryableFetchError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.isAuthSessionMissingError": { "name": "@supabase/supabase-js.isAuthSessionMissingError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "any" } } ] }, "@supabase/supabase-js.isAuthWeakPasswordError": { "name": "@supabase/supabase-js.isAuthWeakPasswordError", "params": [ { "name": "error", "type": { "type": "intrinsic", "name": "unknown" } } ] }, "@supabase/supabase-js.navigatorLock": { "name": "@supabase/supabase-js.navigatorLock", "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. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." } }, { "name": "fn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } } }, "comment": { "shortText": "The operation to run once the lock is acquired." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } }, "comment": { "shortText": "Implements a global exclusive lock using the Navigator LockManager API. It\nis available on all browsers released after 2022-03-15 with Safari being the\nlast one to release support. If the API is not available, this function will\nthrow. Make sure you check availablility before configuring GoTrueClient.\n\nYou can turn on debugging by setting the `supabase.gotrue-js.locks.debug`\nlocal storage item to `true`.\n\nInternals:\n\nSince the LockManager API does not preserve stack traces for the async\nfunction passed in the `request` method, a trick is used where acquiring the\nlock releases a previously started promise to run the operation in the `fn`\nfunction. The lock waits for that promise to finish (with or without error),\nwhile the function will finally wait for the result anyway." } }, "@supabase/supabase-js.processLock": { "name": "@supabase/supabase-js.processLock", "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. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." } }, { "name": "fn", "type": { "type": "function", "params": [], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } } }, "comment": { "shortText": "The operation to run once the lock is acquired." } } ], "ret": { "type": { "type": "promise", "name": "Promise", "awaited": { "type": "nameOnly", "name": "R" } } }, "comment": { "shortText": "Implements a global exclusive lock that works only in the current process.\nUseful for environments like React Native or other non-browser\nsingle-process (i.e. no concept of \"tabs\") environments.\n\nUse #navigatorLock in browser environments.", "examples": [ { "id": "example-1", "name": "Example 1", "code": "```ts\nawait processLock('migrate', 5000, async () => {\n await runMigration()\n})\n```" } ] } } }, "variables": { "@supabase/auth-js.AuthAdminApi": { "name": "@supabase/auth-js.AuthAdminApi", "isConst": true }, "@supabase/auth-js.AuthClient": { "name": "@supabase/auth-js.AuthClient", "isConst": true }, "@supabase/auth-js.lockInternals": { "name": "@supabase/auth-js.lockInternals", "type": { "type": "object", "properties": [ { "name": "debug", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "", "tags": [ { "tag": "experimental", "text": "" } ] } } ] }, "comment": { "shortText": "", "tags": [ { "tag": "experimental", "text": "" } ] }, "isConst": true }, "@supabase/auth-js.SIGN_OUT_SCOPES": { "name": "@supabase/auth-js.SIGN_OUT_SCOPES", "isConst": true }, "@supabase/postgrest-js.default": { "name": "@supabase/postgrest-js.default", "type": { "type": "object", "properties": [ { "name": "PostgrestBuilder" }, { "name": "PostgrestClient" }, { "name": "PostgrestError" }, { "name": "PostgrestFilterBuilder" }, { "name": "PostgrestQueryBuilder" }, { "name": "PostgrestTransformBuilder" } ] }, "isConst": false }, "@supabase/realtime-js.REALTIME_CHANNEL_STATES": { "name": "@supabase/realtime-js.REALTIME_CHANNEL_STATES", "type": { "type": "object", "properties": [ { "name": "closed", "type": { "type": "literal", "value": "closed" } }, { "name": "errored", "type": { "type": "literal", "value": "errored" } }, { "name": "joined", "type": { "type": "literal", "value": "joined" } }, { "name": "joining", "type": { "type": "literal", "value": "joining" } }, { "name": "leaving", "type": { "type": "literal", "value": "leaving" } } ] }, "isConst": true }, "@supabase/supabase-js.cors.corsHeaders": { "name": "@supabase/supabase-js.cors.corsHeaders", "type": { "type": "record", "name": "CorsHeaders", "keyType": { "type": "intrinsic", "name": "string" }, "valueType": { "type": "intrinsic", "name": "string" } }, "comment": { "shortText": "Default CORS headers for Supabase Edge Functions.\n\nIncludes all headers sent by Supabase client libraries and allows all standard HTTP methods.\nUse this for simple CORS configurations with wildcard origin.", "examples": [ { "id": "basic-usage", "name": "Basic usage", "code": "```typescript\nimport { corsHeaders } from '@supabase/supabase-js/cors'\n\nDeno.serve(async (req) => {\n if (req.method === 'OPTIONS') {\n return new Response('ok', { headers: corsHeaders })\n }\n\n return new Response(\n JSON.stringify({ data: 'Hello' }),\n { headers: { ...corsHeaders, 'Content-Type': 'application/json' } }\n )\n})\n```" } ] }, "isConst": true }, "@supabase/supabase-js.AuthAdminApi": { "name": "@supabase/supabase-js.AuthAdminApi", "isConst": true }, "@supabase/supabase-js.AuthClient": { "name": "@supabase/supabase-js.AuthClient", "isConst": true }, "@supabase/supabase-js.lockInternals": { "name": "@supabase/supabase-js.lockInternals", "type": { "type": "object", "properties": [ { "name": "debug", "type": { "type": "intrinsic", "name": "boolean" }, "comment": { "shortText": "", "tags": [ { "tag": "experimental", "text": "" } ] } } ] }, "comment": { "shortText": "", "tags": [ { "tag": "experimental", "text": "" } ] }, "isConst": true }, "@supabase/supabase-js.REALTIME_CHANNEL_STATES": { "name": "@supabase/supabase-js.REALTIME_CHANNEL_STATES", "type": { "type": "object", "properties": [ { "name": "closed", "type": { "type": "literal", "value": "closed" } }, { "name": "errored", "type": { "type": "literal", "value": "errored" } }, { "name": "joined", "type": { "type": "literal", "value": "joined" } }, { "name": "joining", "type": { "type": "literal", "value": "joining" } }, { "name": "leaving", "type": { "type": "literal", "value": "leaving" } } ] }, "isConst": true }, "@supabase/supabase-js.SIGN_OUT_SCOPES": { "name": "@supabase/supabase-js.SIGN_OUT_SCOPES", "isConst": true } } } }