cometchat / chat-sdk-javascript

Voice & Video Calling and Text Chat SDK for JavaScript/Web
Other
30 stars 24 forks source link

Not able to initialize the App #6

Closed dushyantRathore closed 5 years ago

dushyantRathore commented 5 years ago

I have the folder directory similar to the image shown below : Capture

I have installed the node module using npm.

Now, when I try to run the following code block by importing the module in html code the file test.html, I don't see anything in the console output.

<html>
<head>
</head>
<body>
<script type="text/html">
import { CometChat } from "./node_modules/@cometchat-pro/chat";
var appID = "MY_APP_ID";
CometChat.init(appID).then(
  hasInitialized => {
    console.log("Initialization completed successfully", hasInitialized);
    // You can now call login function.
  },
  error => {
    console.log("Initialization failed with error:", error);
    // Check the reason for error and take apppropriate action.
  }
);
</script>

</body>
</html>

If possible, can you redirect me to a working javascript code for the same..since it lacks in the documentation/Github repo as well

ajaygajra commented 5 years ago

Hello @dushyantRathore If you wish to use it with javascript browser environment, you can include the script in following way

dushyantRathore commented 5 years ago

Got it working..thanks.