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 _deleteFactor;
private _listFactors;
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?: "global" | "local" | "others"): 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

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

Contains all MFA administration methods.

§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 (setting deleted_at to the current timestamp and disabling their account while preserving their data) from the auth schema. 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?: "global" | "local" | "others"): 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.