> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: getMember(options: FieldsetOptions)

# Method package: wixMembersBackend

# Method menu location: wixMembersBackend --> CurrentMember --> getMember

# Method Link: https://dev.wix.com/docs/velo/apis/wix-members-backend/current-member/get-member.md

# Method Description:

Retrieves the currently logged-in member.


The `getMember()` function returns a Promise that resolves
to the currently logged-in member.

> **Notes:**
> - Currently, this function throws an error if a member isn't logged in. However, the frontend [`currentMember.getMember()`](https://dev.wix.com/docs/velo/api-reference/wix-members-frontend/current-member/get-member.md) resolves to `undefined` if a member isn't logged in. This function may change in the future to align with the frontend `currentMember.getMember()`.
> - The APIs in `CurrentMember` are only partially functional when previewing your site. View a published version of your site to see their complete functionality.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Get the currently logged-in member

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { currentMember } from 'wix-members-backend';

// Sample options value:
// {
//   fieldsets: [ 'FULL' ]
// }

export const myGetCurrentMemberFunction = webMethod(Permissions.Anyone, async (options) => {
  try {
    const member = await currentMember.getMember(options);
    const memberId = member._id;
    const fullName = `${member.contactDetails.firstName} ${member.contactDetails.lastName}`;
    const memberProfilePage = `https://yoursite.com/profile/${member.profile.slug}/profile`;

    return member;
  } catch (error) {
    console.error(error);
  }
});

/* Promise resolves to:
 * {
 *   "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9",
 *   "_createdDate": "2021-08-02T23:14:42.000Z",
 *   "_updatedDate": "2021-08-02T23:14:58.345Z",
 *   "lastLoginDate": "2021-08-04T05:10:21.000Z",
 *   "loginEmail": "claude.morales@example.com",
 *   "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9",
 *   "status": "APPROVED",
 *   "privacyStatus": "PUBLIC",
 *   "activityStatus": "ACTIVE",
 *   "profile": {
 *     "nickname": "Claude Morales",
 *     "slug": "claudemorales",
 *     "profilePhoto": {
 *       "url": "//static.wixstatic.com/media/a27d24_0dd318~mv2.jpg",
 *       "height": 256,
 *       "width": 256,
 *       "offsetX": 1,
 *       "offsetY": 1
 *     },
 *     "coverPhoto": {
 *       "url": "https://example.com/myimage.jpg",
 *       "height": 1080,
 *       "width": 1920,
 *       "offsetX": 1,
 *       "offsetY": 1
 *     },
 *     "title": "Awesome title"
 *   },
 *   "contactDetails": {
 *     "firstName": "Claude",
 *     "lastName": "Morales",
 *     "phones": [
 *       "0747-769-460"
 *     ],
 *     "emails": [
 *       "claude.morales@example.com"
 *     ],
 *     "addresses": [
 *       {
 *         "country": "GB"
 *       },
 *       {
 *         "_id": "f0f4d905-488d-44db-9080-fc29078cfad5",
 *         "addressLine": "9373 Park Avenue",
 *         "addressLine2": "Berkshire",
 *         "city": "Ely",
 *         "subdivision": "GB-ENG",
 *         "country": "GB",
 *         "postalCode": "PD50 8EU"
 *       }
 *     ],
 *     "customFields": {
 *       "custom.pronouns": {
 *         "name": "Pronouns",
 *         "value": "they/them"
 *       },
 *       "custom.nickname": {
 *         "name": "Nickname",
 *         "value": "Cee"
 *       }
 *     }
 *   }
 * }
 */
```

---