NPM package for SDK?
in JavaScript
I have been looking to see if there is a NPM package (for use with things like nodejs. I have not found one.
Am I missing it?
If not, there REALLY aught to be an npm package...
Am I missing it?
If not, there REALLY aught to be an npm package...
0
Comments
const photon = require('libraries/photonsdk/Photon-Javascript_SDK');
// import { Exitgames } from 'libraries/photonsdk/Photon-Javascript_SDK';
It says module not found for the import, but doing a standard require does not seem to work even a little.
Unless I am doing something very wrong, this seems to be not ready for a node environment.
Below is a sample app running in nodejs.
To load Photon lib from local storage, 'fs' and 'vm' package are used.
Since Photon js sdk relies on browser's WebSocket object, you need to implement its interface with websocket you use in nodejs.
Really they aught to just make an NPM package... I looked into it, but it looks like it would require a bit of restructuring.
When I try to run, I still get even though I am using your example.
Does this code run alone work for you? Don't forget to set appID.