VideoKit Node.js Session Example

node v10.24.1
version: 3.0.0
endpointsharetweet
var tonicExpress = require("@runkit/runkit/express-endpoint/1.0.0") const { VKitClient } = require('@video-io/videokit-nodejs') var app = tonicExpress(module.exports) const vkit = new VKitClient({ appSecret: 'YOUR_API_KEY' }) app.get("/", (req, res) => res.send("Invalid")) app.get("/token/:identity", async (req, res) => { if (!req.params.hasOwnProperty("identity") || req.params.identity === null) { return res.send('{"status": 0}') } try { const response = await vkit.getSessionToken(req.params.identity) return res.send(response) } catch(e) { console.log(e) } return res.send('{"status": 0}') })
Loading…

no comments

    sign in to comment