How to use the quickblox.createSession function in quickblox

To help you get started, we’ve selected a few quickblox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aichaos / rivescript-js / eg / quickblox-bot / index.js View on Github external
body: reply,
						extension: {
							save_to_history: 1
						}
					};

					QB.chat.send(userId, answer);
				})

			}
		}
	}
};

// Create QuickBlox session
QB.createSession({
	login: CONFIG.user.login,
	password: CONFIG.user.password
}, (createSessionError, res) => {
	if(createSessionError) {
		console.error('[QB] createSession is failed', JSON.stringify(createSessionError));
		process.exit(1);
	}

	// Connect to Real-Time Chat
	QB.chat.connect({
		userId: CONFIG.user.id,
		password: CONFIG.user.password
	}, (chatConnectError) => {
		if (chatConnectError) {
			console.log('[QB] chat.connect is failed', JSON.stringify(chatConnectError));
			process.exit(1);

quickblox

QuickBlox JavaScript SDK

(Apache-2.0)
Latest version published 1 month ago

Package Health Score

71 / 100
Full package analysis