@softobotics/storefront-account
v0.1.0
Published
Headless customer account: profile/address/order queries and mutations, for storefronts built on @softobotics/storefront-vendure-client and @softobotics/storefront-auth.
Keywords
Readme
@softobotics/storefront-account
Headless customer account: profile, address book, and order-history queries/mutations,
built on @softobotics/storefront-vendure-client and @softobotics/storefront-auth.
Usage
import {useActiveCustomer} from '@softobotics/storefront-account';
const {customer, isLoading, refresh} = useActiveCustomer();import {createAddress} from '@softobotics/storefront-account';
const address = await createAddress({fullName, streetLine1, city, province, postalCode, countryCode, phoneNumber});updatePasswordAction/updateCustomerAction/requestEmailUpdateAction take a translated
message lookup (t) as a parameter, same as storefront-auth's actions — see that package's
README for why.
Scope: headless only
See @softobotics/storefront-auth's README — the same "no UI components" scoping applies
here.
Why ActiveCustomerFragment/GetActiveCustomerQuery aren't defined here
They live in @softobotics/storefront-auth (re-exported here for convenience) because
AuthProvider is what actually calls that query. See that package's README.
