Get started with deepstream.io-client-js CDN
Apache-2.0 licensed
Deepstream.io-client-js is a library for real-time communication with Deepstream.io platform.
Tags:- deepstream
- realtime
- server
- datasync
- pubsub
- rpc
- streaming
Stable version
Copied!
How to start using deepstream.io-client-js CDN
// Include Deepstream.io client library from CDN
const Deepstream = require('deepstream.io-client-js');
// Initialize the Deepstream client with the server URL
const client = new Deepstream.Client('wss://your-deepstream-server-url:4433/');
// Connect to the server
client.on('connect', () => {
console.log('Connected to Deepstream server.');
// Create a new text message channel
const textChannel = client.record('textMessages');
// Subscribe to the text message channel
textChannel.on('deepstream.event:subscribe', () => {
console.log('Subscribed to text message channel.');
// Listen for incoming messages
textChannel.on('new_message', (message) => {
console.log(`Received message: ${message}`);
});
});
// Send a test message to the text message channel
textChannel.emit('send_message', 'Hello, Deepstream!');
});
// Handle errors
client.on('error', (error) => {
console.error('Error:', error);
});
// Connect to the Deepstream server
client.connect();
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.2.1
0.2.11
0.2.12
0.2.13
0.2.14
0.2.15
0.2.18
0.2.19
0.2.2
0.2.20
0.2.22
0.2.3
0.2.4
0.2.5
0.2.6
0.2.7
0.2.8
0.2.9
0.3.0
0.3.1
0.3.10
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.3.7
0.3.8
0.3.9
0.4.0
0.4.1
0.4.2
0.4.3
0.5.0
1.0.0
1.0.0-beta.1
1.0.1
1.0.2
1.1.0
1.1.1
2.0.0
2.0.0-rc.1
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.2.0
2.2.1
2.3.0
2.3.1
2.3.3
*** 2.3.4
4.0.0-beta.1
4.0.0-rc.12
4.0.0-rc.13
4.0.0-rc.14
4.0.0-rc.15
4.0.0-rc.16
4.0.0-rc.3