Skip to content

CustomerModule

Module in @evolve-framework/commercetools

The signed-in customer on commercetools: customer and customerExists, registration and deletion, and the mutations for addresses, default addresses, personal details, email and notification preferences.

import { CustomerModule } from "@evolve-framework/commercetools";

Serves the Customer part of the GraphQL API: customer, customerExists, customerAddressCreate, customerAddressDelete, customerAddressUpdate, customerCreate, customerDefaultAddressUpdate, customerDelete, customerEmailUpdate, customerInformationUpdate, customerNotificationPreferencesUpdate, customerPersonalDetailsUpdate.

new CustomerModule(options: { config: CustomerModuleConfig; customTypes: CustomerCustomTypeKeys; })
OptionTypeDescription
configCustomerModuleConfig

The commercetools project, auth URL and user API client that customer tokens are requested from: registration signs the new customer in, and deleting a customer starts a guest session in its place.

customTypesCustomerCustomTypeKeys

Keys of the custom types this project has provisioned for a customer and, when addresses carry a name, for an address.

CustomerModuleConfig5The fields of config.
FieldTypeDescription
CTP_PROJECT_KEYstring
CTP_AUTH_URLstring
CTP_USER_CLIENT_ID?string
CTP_USER_CLIENT_SECRET?string
CTP_USER_SCOPES?string[]

Falls back to DEFAULT_USER_SCOPES when left out.

Extends AbstractModule<CommercetoolsLoaderContext>.

The same module on medusa and sfcc.