adobe / aem-headless-client-nodejs

AEM Headless Client for Node.js
Apache License 2.0
9 stars 1 forks source link

Integrate with the aio-sdk-core features #8

Closed meryllblanchet closed 2 years ago

meryllblanchet commented 3 years ago

As available at: https://github.com/adobe/aio-sdk-core

@shazron can guide @easingthemes if needed.

shazron commented 3 years ago

Some thoughts:

  1. Create a Static Error class via @adobe/aio-lib-core-errors see https://github.com/adobe/aio-lib-core-errors#static-errors a. example https://github.com/adobe/aio-lib-campaign-standard/blob/master/src/SDKErrors.js b. example https://github.com/adobe/aio-lib-campaign-standard/blob/516eea655b3fb297c7adc903d74aedb2e999707e/src/index.js#L796
  2. Use the @adobe/aio-lib-core-logging library like so https://github.com/adobe/aio-lib-campaign-standard/blob/516eea655b3fb297c7adc903d74aedb2e999707e/src/index.js#L19
  3. Use the adobe/aio-lib-core-networking library instead of cross-fetch for retries with exponential backoff a. example https://github.com/adobe/aio-lib-events/blob/a87498773a19bea0aa8a94d77d501b9a6376fc8b/src/index.js#L393
  4. Instead of passing a filepath for credentials here: https://github.com/adobe/aem-headless-client-nodejs/blob/406bc72e6ba812c4d3230108388888d9bc220b12/src/utils/auth.js#L23 : a. use the @adobe/aio-lib-core-config library to read the credentials b. credentials are set via an .aio, .env file or config command aio config set my-key.my-sub-key my-value
meryllblanchet commented 3 years ago

Thanks @shazron ! @easingthemes are you good with these recommendations? Do you need some help?

easingthemes commented 3 years ago

All clear, thanks @shazron