Skip to main content

Documentation Index

Fetch the complete documentation index at: https://86d.app/docs/llms.txt

Use this file to discover all available pages before exploring further.

The customers module manages the customer record that backs every authenticated shopper. It exposes account self-service endpoints (profile read and update, change email, change password) and a complete admin CRUD surface for searching, filtering, and editing customer records. It is required by @86d-app/loyalty, @86d-app/saved-addresses, @86d-app/customer-groups, and most engagement modules. Source: modules/customers · npm: @86d-app/customers

Installation

86d module add customers
Then run 86d generate.

Configuration

The customers module accepts no configuration options. Initialize it with no arguments:
import customers from "@86d-app/customers";
import { createModuleClient } from "@86d-app/core";

const client = createModuleClient([customers()]);

Store endpoints

MethodPathDescription
GET/customers/meGet the authenticated customer’s profile
PUT/customers/meUpdate profile (name, phone, marketing opt-in)
POST/customers/me/change-emailRequest an email change (sends verification)
POST/customers/me/change-passwordChange the password
DELETE/customers/meSoft-delete the account
All store endpoints require an authenticated session.

Admin endpoints

MethodPathDescription
GET/admin/customersList customers (paginated, filterable by status, tag)
GET/admin/customers/searchFull-text search by name, email, or phone
GET/admin/customers/:idGet a customer record
PUT/admin/customers/:idUpdate fields
POST/admin/customers/:id/suspendSuspend account
POST/admin/customers/:id/reactivateReactivate account
DELETE/admin/customers/:idHard-delete (use with care)

Components

ComponentPurpose
<AccountPage />Full customer self-service page (profile, addresses, orders, loyalty)
<CustomerDetails />Editable name and contact form
<EmailChangeForm />Inline email-change form with verification

Types

type CustomerStatus = "active" | "suspended" | "closed";

interface Customer {
  id: string;
  email: string;
  firstName?: string;
  lastName?: string;
  phone?: string;
  status: CustomerStatus;
  marketingOptIn: boolean;
  tags: string[];
  metadata: Record<string, unknown>;
  createdAt: Date;
  updatedAt: Date;
}