cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CDC WebSDK configuration not loading

vromeo
Explorer
0 Kudos

Hi there,

I have created a parent site with a single child and put some JS logic in the parent's WebSDK configuration.

Then I created a simple web page and correctly referenced the Gigya library (based on the child ApiKey).

When the page loads, the logic inside the WebSDK configuration does not fire. I have tried simply adding a console.log() but nothing,

Could you please help me?

Thanks,

Valerio

Accepted Solutions (1)

Accepted Solutions (1)

shemma
Advisor
Advisor
0 Kudos

Hi,

After loading gigya.js did you tried to perform any flow?

Can you try to run showScreenSet and check?

vromeo
Explorer
0 Kudos

Hi, yes the showScreenSet function works properly. There aren't any custom logics except for the WebSDK. It's pretty strange.

shemma
Advisor
Advisor
0 Kudos

Hi,

After calling showScreenSet did you code was executed in the WebSDKConfiguration?

If not please share your apiKey and we will check.

vromeo
Explorer
0 Kudos
Hi, not it's not executed. Parent apiKey: 4_4aoKYt6YQl0Hg7ePTHitmg Child: 4_NT5P9lt5l295sH2vsU5nGA
shemma
Advisor
Advisor
0 Kudos

.

shemma
Advisor
Advisor
0 Kudos
Hi, The SDK basically merge the parent site configuration with the child site configuration, giving priority to the child site configuration. And the reason it is not working for you is because the child site config also contains “eventMap” key which takes precedence. To solve it you can basically delete the “eventMap” from the child site.
vromeo
Explorer
0 Kudos

Hi, I tried but the problem persists. This is the code for the child site:

{
    // A comma-delimited list of provider names to enable.
    enabledProviders: '*',

    // Define the language of Gigya's user interface and error message.
    lang: 'en',

    // Bind globally to events.
    customEventMap: {
    }
}
shemma
Advisor
Advisor

Hi,

Please try to remove the "customEventMap" and try.

If it does not help please open a case to the CDC SDK team and we will check.

Answers (2)

Answers (2)

vromeo
Explorer
0 Kudos

Hi, completely removing the customEventMap from the child works.

Anyway, it's strange because according to the documentation, the custom logic of the parent should be merged into the child.

Thanks

shemma
Advisor
Advisor
0 Kudos

Hi,

Can you please share the code you are using.

vromeo
Explorer
0 Kudos
Hi shemma,
vromeo
Explorer
0 Kudos
this is the code in the parent site:
vromeo
Explorer
0 Kudos

this is the code in the parent site:

{
    // A comma-delimited list of provider names to enable.
    enabledProviders: '*',

    // Define the language of Gigya's user interface and error message.
    lang: 'en',

    // Bind globally to events.
    customEventMap: {
        eventMap: [{
            events: '*',
            args: [function(e) {
                return e;
            }],
            method: function(e) {
            
            	console.log(e);
            
                if (e.fullEventName === 'login') {
                    // Handle login event here.
                } else if (e.fullEventName === 'logout') {
                    // Handle logout event here.
                }
                
                //START RESET PWD HANDLING
                function getParameterByName(name) {
                    var url = window.location.href;
                    name = name.replace(/[\[\]]/g, '\\$&');
                    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
                        results = regex.exec(url);
                    if (!results) return null;
                    if (!results[2]) return '';
                    return decodeURIComponent(results[2].replace(/\+/g, ' '));
                }

                function removeParams() {
                    window.history.pushState({}, document.title, "/");
                }

                window.gigya_custom_screen_shown = window.gigya_custom_screen_shown || false;
                
                if (getParameterByName("forgotPwd") && window.gigya_custom_screen_shown === false) {
                
                    window.gigya_custom_screen_shown = true;
                    gigya.accounts.showScreenSet({
                        screenSet: 'Default-RegistrationLogin',
                        startScreen: 'gigya-forgot-password-screen',
                        onAfterSubmit: function(pwdSubmit) {
                            if (pwdSubmit.response.status !== "FAIL") {
                                removeParams();
                            }
                        }
                    });
                }
                //END RESET PWD HANDLING
            }
        }]
    }
}

I tried just adding a console.log but it doesn't work. Could it depend on the parent/child configuration?