Search.../

deleteMember( )

Deletes a member.

Description

The deleteMember() function returns a Promise that resolves to a member object when the specified member is deleted.

Note: This function replaces the deprecated wix-users-backend.deleteUser(). The deprecated function will continue to work, but it will not receive updates. To keep any existing code compatible with future changes, see the migration instructions.

This function permanently deletes a member. Once deleted, a member cannot be restored.

Syntax

function deleteMember(id: string): Promise<void>

deleteMember Parameters

NAME
TYPE
DESCRIPTION
id
string

ID of the member to delete.

Returns

Fulfilled - When the member is deleted. Rejected - Error message.

Return Type:

Promise<void>

Was this helpful?

Delete a member by ID

Copy Code
1import { members } from 'wix-members-backend';
2
3// Sample id value:
4// 'efab296e-2687-4751-9956-ee73200dd4bb'
5
6export function myDeleteMemberFunction(id) {
7
8 return members.deleteMember(id)
9 .then(() => {
10 console.log('Member deleted');
11 })
12 .catch((error) => {
13 console.error(error);
14 });
15}