The fm.liveswitch
JavaScript Software Development Kit (SDK) is designed for use with both clients and your own backend "app server". It functions smoothly in the frontend thanks to webpack and babel. However, the same import statement:
import liveswitch from 'fm.liveswitch';
does not work on the backend using Node 16.
I encounter an error when attempting to invoke
liveswitch.Token.generateClientRegisterToken(params...)
. This project involves Firebase and React, with the "backend" being the cloud functions. The tsconfig.json
file for the functions directory follows the default configuration provided by Firebase with a few modifications.
{
"compilerOptions": {
"module": "commonjs",
"removeComments": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"alwaysStrict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
]
}