Posted October 10, 2024Oct 10 This video (narrated in Ukrainian by Borys our backend architect engineer) demonstrates integrating Ethora chat with your existing backend. Endpoint request examples are shown. Javascript code sample: const jwt = require("jsonwebtoken") // example of secret const secret = '9ddbf686a76eab7fb35e2f447e66cc0b' const appId = '6706332db1b1a4e984d3c7bc' const craeteServerToken = function() { return jwt.sign({data: {appId, type: 'server'}}, secret, { // expiresIn: 60000, algorithm: 'HS256' }) } function createClientToken(userId) { return jwt.sign( // jwt payload should include current userId & appId {data: {type: 'client', userId: userId, appId: appId}}, // only backend should know secret secret, // token options { expiresIn: 480, algorithm: 'HS256' }) } console.log("server token ", craeteServerToken()) console.log("client token ", createClientToken("mock4")) Also attached below is a Postman file demonstrating server token and client token generation. dappros-deepx.postman_collection.json
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.