Conversation
Adds scripts/arp.js to load the Watson SDK per environment and call WatsonSdk.initAsync with a persisted session id, exposing the id and composite token globally for downstream consumers. CSP updates (Step 4 of the ARP integration guide) are pending client configuration and will follow in a separate change.
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
ARP-1280 client configuration is complete and registered under the bacom client id, replacing the placeholder.
Aligns with the convention Universal Nav already uses (window.adobeArp.sessionToken) instead of inventing a new global, so future consumers like Brand Concierge can read session id/token from one shared, predictable location.
| } | ||
| } | ||
|
|
||
| if (CONFIG.arp?.clientId) { |
There was a problem hiding this comment.
We might want an additional check here. For instance, does the document contain the brand-concierge class on any component, or does it have some sort of bc load trigger in metadata. We should discuss the options with @colloyd to see what is most reasonable. Likely something event driven will be better in the future, perhaps having bc dispatch and event when it loads, or Milo utils dispatch and event when it loads.
I know the import is done async, which is good, but the fewer network requests in scripts.js the better. This is non-blocking.
There was a problem hiding this comment.
@JasonHowellSlavin @colloyd : do we want to use metadata here similar to guest token?
There was a problem hiding this comment.
@JasonHowellSlavin @colloyd : do we want to use metadata here similar to guest token?
Hi @disha-akarte , I don't think so. We've two main ways of setting meta-data. Either a sitewide basis using a url slug regex (/*, /products/*) or on a page by page basis.
I think depending on when ARPjs needs to be available we can either have the brand-concierge component send a custom event that we listen to here in scripts, and load ARPjs while brand-concierge is initiating, or we check the DOM if the block is present. With the latter, the problem is that if brand concierge is loaded in a fragment etc. it won't appear in the DOM until it starts to load.
We can discuss further and brainstorm. Happy to have a quick meeting.
|
|
||
| export default async function loadArp({ clientId, prodEnv, loadScript }) { | ||
| const sessionId = getArpSessionId(); | ||
| window.adobeArp = { ...window.adobeArp, sessionId }; |
There was a problem hiding this comment.
Can someone on milo confirm sharing the same name as UNav would be okay here?
There was a problem hiding this comment.
@disha-akarte, @JasonHowellSlavin I would assume this is ok, as unav isn't present on bacom, so I don't expect collisions here.
There was a problem hiding this comment.
Snehal confirmed this was okay @disha-akarte , do you think this is ready to merge and do e2e testing?
disha-akarte
left a comment
There was a problem hiding this comment.
LGTM, please check the comment
|
|
||
| export default async function loadArp({ clientId, prodEnv, loadScript }) { | ||
| const sessionId = getArpSessionId(); | ||
| window.adobeArp = { ...window.adobeArp, sessionId }; |
There was a problem hiding this comment.
Snehal confirmed this was okay @disha-akarte , do you think this is ready to merge and do e2e testing?
Adds scripts/arp.js to load the Watson SDK per environment and call WatsonSdk.initAsync with a persisted session id, exposing the id and composite token globally for downstream consumers. CSP updates (Step 4 of the ARP integration guide) are pending client configuration and will follow in a separate change.
Resolves: MWPW-200860
Test URLs: