ClientAuthBridge

cart · /react·type

Minimal React hook contract that exposes buyer identity to without coupling the cart to a specific auth library. Implement this interface in the host app and pass it via CartProviderProps.clientAuthBridge.

Properties

useBuyerIdentity
unknown

Example

const bridge: ClientAuthBridge = {
  useBuyerIdentity() {
    const { user } = useAuth();
    return { identity: user ? { email: user.email } : null, updatedAt: user?.updatedAt ?? 0 };
  },
};

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

Metadata@nordcom/commerce-cart@0.2.2Open in GitHub ↗

On this page