Google Authentication Import Error

Hey everyone, I am trying to implement google authentication for my cross-platform game. I am having some trouble when importing from ‘https://apis.google.com/js/platform.js’ in order to use gapi to load and initialize an authentication client. The error I get is:

[Scene] Unable to instantiate module https://apis.google.com/js/platform.js from project:///assets/Script/Login/gl_login.js

I am pretty new to Cocos Creator and I am I think I am making a mistake with the way I am importing. Any help would be much appreciated. Thanks!

How did you include the script https://apis.google.com/js/platform.js? The best way is used as plugin script, refer this document.
Plugin Scripts · Cocos Creator

Hello. Thanks for the reply! I have tried adding the script manually and then declaring it in a .d.ts file which I then included in the tsconfig.json. Is adding a plugin script available in Cocos Editor 3.0.0?

Yes, Cocos Editor 3.0.0 is OK.

Hi, thanks for clarifying that for me. I couldn’t import the script as plug-in. In the plugin script manual page it is stated that in order to import as plugin I need to check the box within the scripts properties, but I was not able to locate the properties panel. All the panels I can see in my editor are Console, Scene, Assets, Inspector, Hierarchy, Preview, Animation and Node Library. How can I access the Properties panel of the script in order to make the change?

plugin script setting show in this panel? can you see it?

Yes, I was able to locate it thanks so much for the help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.