[Alokai x SFCC] Account creation extension
Hello gurus !
In an alokai project we have the SFCC integration configured and the OOTB project works well.
We want to add some information on
Customer
creation (like phone, gender,...) during the sdk.unified.registerCustomer()
call.
I started following the guide here https://docs.alokai.com/middleware/guides/extensions#creating-an-extension but when implementing the new registerCustomer
method, the SFCCIntegrationContext.api.register()
method expects a CustomerRegisterParams
preventing me from passing additional parameters to the SCAPI call.
What is the best approach ? Should I make my own SCAPI call in my extension or is there a way to extends the SFCCIntegrationContext.api.register()
method ?
Kind regardsAlokai
Extending the Middleware
When developing your storefront, there will be times when you need to customize the way the middleware and integrations run. For example, you might want to add or edit a new API endpoint or even modify the Express.js application itself. Alokai's Server Middleware allows you to do this using extensions.
2 Replies
Hello,
it would be better to make your own SCAPI call in your extension. It might be tempting to override/extend the integration method but it would be cumbersome and might break some other things that depend on it. It is safer and cleaner to create a new method in the extension.
Thanks @Mateusz Ostafil 😉