How to install SDKs with cdn, npm or yarn?

1 favourites
  • 9 posts
From the Asset Store
Easily integrate Telegram Mini Apps SDK into your Construct 3 projects for building interactive apps and games.
  • Hello.

    I want to install the Mongodb Realm Web SDK into my client so that I can use its authentication and other features.

    How can I do this? I was following this documentation but I just don't know how to do this in Construct 3 (or in general, lol).

    Thanks in advance!

  • Any ideas?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is an example project showing how to load and use the SDK.

    dropbox.com/s/fv29dv17pelushl/LoadScriptFromCDN.c3p

    The only way I got it to work was by using a script tag with the url of the SDK. When the script is loaded and executed it creates the global variable Realm which you can use to do whatever it is supposed to do.

    The project uses two scripts. The first scriptLoad.js defines the function that loads a script tag with a provided URL. It has it's Purpose property set to (not set). This means C3 doesn't do anything with it that you don't explicitly tell it to.

    The other script, importForEvents.js has it's Purpose property set to Import for events. This one just imports the first script so the function to load a script tag is available in event sheets.

    Since the loading is asynchronous, the load function returns a promise that will resolve to true or false depending on wether loading was successfull or not. So make sure to always check for that before using the global Realm property.

    The example only prints to console, so press F12 to bring up dev tools for the preview window to see if it is working or not.

  • DiegoM

    Wow this is super awesome! You even made an example for me. <3

    I'm really looking forward to returning home later so that I can test it.

    Edit:

    Thank you again so much for your help and efforts. It works perfectly that way! Now I just have to figure out how I can handle the redirection-url-thing.

    My first guess would be to check the apps url on start of the layout. If it contains the redirect information, then handle Realm.handleAuthRedirect(); and if not do the login stuff to get logged in and redirected.

    About the installing SDK part: Even though it is relatively advanced and pretty nieche I think it might be worth to include this to the example projects as it is very powerful to be able to install SDKs. :)

  • Sorry for posting this in a month old thread, but I have a question regarding the use of the MongoDB Realm SDK on Construct 3:

    If I am creating a game that I will export for both Web, Android, and iOS, should I always use the Web SDK? Or will I have issues after exporting du Android and iOS?

    Thanks.^^

  • Hey there!

    Currently I don't know yet if it will have any negative side effects.

    But from my understanding it should have no downsides. But I'm not sure.

    In a couple of days I should be able to test this. I will post an update then.

  • Perfect, thank you very much.

    I look forward to hearing from you! ^^

  • Hey there!

    Currently I don't know yet if it will have any negative side effects.

    But from my understanding it should have no downsides. But I'm not sure.

    In a couple of days I should be able to test this. I will post an update then.

    Hi Nilom,

    is there any news about your tests? I was very interested in the integration of MongoDB on Contruct 3.^^

  • Sorry it was a very busy month for me. I was not able to work extensively on my project.

    Currently I'm somewhat stuck with this problem. I suspect it's an issue with the official facebook plugin.

    When I get this white screen issue solved I can test if the app works like in remote preview on mobile.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)