Search.../

makeProfilePublic( )

Joins the currently logged-in member to the site community and sets their profile to public.

Description

The makeProfilePublic() function returns a Promise that resolves to a member object when the member's profile privacy is updated.

When a member's profile is public, they have access to the site's Members Area features — such as chat, forum, and followers — and their profile is visible to other members and site visitors.

Note: The APIs in CurrentMember are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

Syntax

function makeProfilePublic(): Promise<Member>

makeProfilePublic Parameters

This function does not take any parameters.

Returns

Fulfilled - Updated member.

Return Type:

Promise<Member>
NAME
TYPE
DESCRIPTION
_id
string

Member ID.

loginEmail
string

Email used by the member to log in to the site.

status
string

Member site access status.

One of:

  • "PENDING": Member created and is waiting for approval by site owner.
  • "APPROVED": Member can log in to the site.
  • "OFFLINE": Member is a guest author for the site blog and cannot log in to the site.
  • "BLOCKED": Member is blocked and cannot log in to the site.
  • "UNKNOWN": Insufficient permissions to get the status.
contactId
string

Contact ID.

privacyStatus
string

Member privacy status.

One of:

  • "PUBLIC": Member is visible to everyone.
  • "PRIVATE": Member is hidden from site visitors and other site members. Member is returned only to site contributors and apps with the appropriate permissions.
  • "UNKNOWN": Insufficient permissions to get the status.
activityStatus
string

Member activity status.

One of:

  • "ACTIVE": Member can write forum posts and blog comments.
  • "MUTED": Member cannot write forum posts or blog comments.
  • "UNKNOWN": Insufficient permissions to get the status.
_createdDate
Date

Date and time when the member was created.

_updatedDate
Date

Date and time when the member was updated.

lastLoginDate
Date

Date and time when the member last logged in to the site.

contactDetails
ContactDetails

Member's contact information. Contact information is stored in the Contact List.

profile
Profile

Profile display info.

Related Content:

Was this helpful?

Make the currently logged-in member's profile public

Copy Code
1import { currentMember } from 'wix-members-backend';
2
3export function myMakeProfilePublicFunction() {
4 return currentMember.makeProfilePublic()
5 .then((updatedMember) => {
6 const newPrivacyStatus = updatedMember.privacyStatus;
7 return updatedMember;
8 })
9 .catch((error) => {
10 console.error(error);
11 })
12}
13
14/* Promise resolves to:
15 * {
16 * "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9",
17 * "_createdDate": "2021-08-02T23:14:42.000Z",
18 * "_updatedDate": "2021-08-02T23:14:58.345Z",
19 * "lastLoginDate": "2021-08-04T11:02:44.000Z",
20 * "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9",
21 * "loginEmail": "claude.morales@example.com",
22 * "status": "APPROVED",
23 * "privacyStatus": "PUBLIC",
24 * "activityStatus": "ACTIVE",
25 * "contactDetails": {
26 * "firstName": "Claude",
27 * "lastName": "Morales",
28 * "phones": [
29 * "0747-769-460"
30 * ],
31 * "emails": [
32 * "claude.morales@example.com"
33 * ],
34 * "addresses": [
35 * {
36 * "_id": "f0f4d905-488d-44db-9080-fc29078cfad5",
37 * "addressLine": "9373 Park Avenue",
38 * "addressLine2": "Berkshire",
39 * "city": "Ely",
40 * "subdivision": "GB-ENG",
41 * "country": "GB",
42 * "postalCode": "PD50 8EU"
43 * }
44 * ],
45 * "customFields": {}
46 * },
47 * "profile": {
48 * "nickname": "Claude Morales",
49 * "slug": "claudemorales"
50 * }
51 * }
52 */