> ## Documentation Index
> Fetch the complete documentation index at: https://usegately.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Members

> Manage your project members and their data

Members are users who have signed up for your project. Gately provides a complete member management system with profiles, plans, and activity tracking.

## Overview

<CardGroup cols={2}>
  <Card title="User Profiles" icon="user">
    Store and manage user information
  </Card>

  <Card title="Plans & Tiers" icon="crown">
    Assign members to subscription plans
  </Card>

  <Card title="Activity Tracking" icon="chart-line">
    Monitor member engagement
  </Card>

  <Card title="Custom Fields" icon="sliders">
    Add custom data to member profiles
  </Card>
</CardGroup>

## Member Properties

| Property        | Type     | Description                     |
| --------------- | -------- | ------------------------------- |
| `id`            | string   | Unique member identifier        |
| `email`         | string   | Member's email address          |
| `full_name`     | string   | Display name                    |
| `avatar_url`    | string   | Profile picture URL             |
| `plan_id`       | string   | Current subscription plan       |
| `status`        | string   | `active`, `inactive`, `pending` |
| `metadata`      | object   | Custom fields                   |
| `created_at`    | datetime | Registration date               |
| `last_login_at` | datetime | Last login timestamp            |

## Dashboard Features

### Member List

View all members in a searchable, filterable table:

* Search by name or email
* Filter by plan, status, or date range
* Sort by any column
* Export to CSV

### Member Details

Click on any member to view:

* Profile information
* Subscription history
* Activity log
* Custom field values

### Bulk Actions

* Send email campaigns to selected members
* Change plans for multiple members
* Export member data
* Delete inactive members

## API Usage

### List Members

```bash theme={null}
curl -X GET "https://api.usegately.com/api/v1/members" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: your-project-id"
```

### Get Member

```bash theme={null}
curl -X GET "https://api.usegately.com/api/v1/members/{member_id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: your-project-id"
```

### Update Member

```bash theme={null}
curl -X PUT "https://api.usegately.com/api/v1/members/{member_id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: your-project-id" \
  -H "Content-Type: application/json" \
  -d '{
    "full_name": "John Doe",
    "plan_id": "premium",
    "metadata": {
      "company": "Acme Inc"
    }
  }'
```

## SDK Usage

### Get Current User

```javascript theme={null}
const user = gately.getUser()
console.log(user.email, user.full_name)
```

### Update Profile

```javascript theme={null}
await gately.updateUserProfile({
  full_name: 'John Doe',
  avatar_url: 'https://example.com/avatar.jpg',
  metadata: {
    company: 'Acme Inc',
    role: 'Developer'
  }
})
```

### Get Full Profile

```javascript theme={null}
const profile = await gately.getUserProfile()
console.log(profile)
```

## Custom Fields

Add custom fields to store additional member data:

1. Go to **Settings > Members > Custom Fields**
2. Click **Add Field**
3. Configure the field:
   * Name (e.g., `company`)
   * Type (text, number, date, boolean, select)
   * Required or optional
4. Save

Custom fields are stored in the `metadata` object:

```javascript theme={null}
const user = gately.getUser()
console.log(user.metadata.company) // "Acme Inc"
```

## Member Plans

Assign members to plans for access control:

```javascript theme={null}
// Check member's plan
const user = gately.getUser()
if (user.plan_id === 'premium') {
  // Show premium content
}
```

### Plan Hierarchy

| Plan         | Access Level      |
| ------------ | ----------------- |
| `free`       | Basic features    |
| `starter`    | Standard features |
| `pro`        | Advanced features |
| `enterprise` | All features      |

## Webhooks

Receive notifications for member events:

| Event                 | Description            |
| --------------------- | ---------------------- |
| `member.created`      | New member signed up   |
| `member.updated`      | Member profile updated |
| `member.deleted`      | Member account deleted |
| `member.plan_changed` | Member changed plans   |

```json theme={null}
{
  "event": "member.created",
  "data": {
    "id": "mem_123",
    "email": "user@example.com",
    "plan_id": "free",
    "created_at": "2024-01-15T10:00:00Z"
  }
}
```

## Best Practices

<AccordionGroup>
  <Accordion title="Data Privacy">
    * Only collect necessary information
    * Provide data export functionality
    * Honor deletion requests promptly
  </Accordion>

  <Accordion title="Security">
    * Use API keys for server-side access only
    * Validate member data before storing
    * Implement rate limiting for profile updates
  </Accordion>

  <Accordion title="Performance">
    * Use pagination for large member lists
    * Cache frequently accessed member data
    * Index custom fields used in queries
  </Accordion>
</AccordionGroup>
