Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

GoTrueAdminApi

class GoTrueAdminApi {
constructor({ url, headers, fetch }: {
url: string;
headers?: {
[key: string]: string;
}
;
fetch?: Fetch;
}
);
private _createOAuthClient;
private _deleteFactor;
private _deleteOAuthClient;
private _getOAuthClient;
private _listFactors;
private _listOAuthClients;
private _regenerateOAuthClientSecret;
protected fetch: Fetch;
protected headers: {
[key: string]: string;
}
;
protected url: string;
 
createUser(attributes: AdminUserAttributes): Promise<UserResponse>;
deleteUser(id: string, shouldSoftDelete?: boolean): Promise<UserResponse>;
generateLink(params: GenerateLinkParams): Promise<GenerateLinkResponse>;
getUserById(uid: string): Promise<UserResponse>;
inviteUserByEmail(email: string, options?: {
data?: object;
redirectTo?: string;
}
): Promise<UserResponse>;
listUsers(params?: PageParams): Promise<{
data: {
users: User[];
aud: string;
}
& Pagination;
error: null;
}
| {
data: {
users: [];
}
;
error: AuthError;
}
>
;
signOut(jwt: string, scope?: SignOutScope): Promise<{
data: null;
error: AuthError | null;
}
>
;
updateUserById(uid: string, attributes: AdminUserAttributes): Promise<UserResponse>;
}

§Constructors

§
new GoTrueAdminApi({ url, headers, fetch }: {
url: string;
headers?: {
[key: string]: string;
}
;
fetch?: Fetch;
}
)
[src]

§Properties

§
_createOAuthClient
[src]

Creates a new OAuth client. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

This function should only be called on a server. Never expose your service_role key in the browser.

§
_deleteFactor
[src]
§
_deleteOAuthClient
[src]

Deletes an OAuth client. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

This function should only be called on a server. Never expose your service_role key in the browser.

§
_getOAuthClient
[src]

Gets details of a specific OAuth client. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

This function should only be called on a server. Never expose your service_role key in the browser.

§
_listFactors
[src]
§
_listOAuthClients
[src]

Lists all OAuth clients with optional pagination. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

This function should only be called on a server. Never expose your service_role key in the browser.

§
_regenerateOAuthClientSecret
[src]

Regenerates the secret for an OAuth client. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

This function should only be called on a server. Never expose your service_role key in the browser.

§
headers: {
[key: string]: string;
}
[src]
§
url: string
[src]
§

Contains all MFA administration methods.

§

Contains all OAuth client administration methods. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.

§Methods

§
createUser(attributes: AdminUserAttributes): Promise<UserResponse>
[src]

Creates a new user. This function should only be called on a server. Never expose your service_role key in the browser.

§
deleteUser(id: string, shouldSoftDelete?: boolean): Promise<UserResponse>
[src]

Delete a user. Requires a service_role key.

@param id

The user id you want to remove.

@param shouldSoftDelete

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. Defaults to false for backward compatibility.

This function should only be called on a server. Never expose your service_role key in the browser.

§
getUserById(uid: string): Promise<UserResponse>
[src]

Get user by id.

@param uid

The user's unique identifier

This function should only be called on a server. Never expose your service_role key in the browser.

§
inviteUserByEmail(email: string, options?: {
data?: object;
redirectTo?: string;
}
): Promise<UserResponse>
[src]

Sends an invite link to an email address.

@param email

The email address of the user.

@param options

Additional options to be included when inviting.

§
listUsers(params?: PageParams): Promise<{
data: {
users: User[];
aud: string;
}
& Pagination;
error: null;
}
| {
data: {
users: [];
}
;
error: AuthError;
}
>
[src]

Get a list of users.

This function should only be called on a server. Never expose your service_role key in the browser.

@param params

An object which supports page and perPage as numbers, to alter the paginated results.

§
signOut(jwt: string, scope?: SignOutScope): Promise<{
data: null;
error: AuthError | null;
}
>
[src]

Removes a logged-in session.

@param jwt

A valid, logged-in JWT.

@param scope

The logout sope.

§
updateUserById(uid: string, attributes: AdminUserAttributes): Promise<UserResponse>
[src]

Updates the user data.

@param attributes

The data you want to update.

This function should only be called on a server. Never expose your service_role key in the browser.