-
Notifications
You must be signed in to change notification settings - Fork 0
Keyboard socket
This is the keyboard socket, this socket will change the typing status of the user with the 'server-keyboard' event. For instance, if a user is typing this socket can change it to not typing. This socket will accept a 'room' argument which is the room of the user who is typing, a 'user' argument which is the user that is typing, a 'key' which is the API key, 'responseToken' which is the response token of the socket and finally, a 'mode' argument which is a start or stops value, needless to say, it's the status of the user typing. Also as I mentioned before, we are NOT using the default websockets, we are using the socket.io library for web sockets.
If you'd like to listen for if a user is typing just listen to the 'keyboard-MODE:room(ROOM)' event. If the 'EVENT' is 'start', then the user started typing and vice versa.
A response token is a token to send a request to if an error occurs.
const io = require("socket.io");
const socket = io("<URL>", { transports: ["websocket"] });
// Send to server
socket.emit(
"server-keyboard",
"<ROOM>",
"<USER>",
"<KEY>",
"<TOKEN>",
"<MODE>"
);
socket.on("keyboard-start:room(<ROOM>)", () => {
/* This will run when a user in the same room types*/
});
socket.on("keyboard-stop:room(<ROOM>)", () => {
/* This will run when a user in the same room stops typing*/
});
- Home
- Login endpoint
- Block user endpoint
- Create room endpoint
- Delete user endpoint
- Get all rooms endpoint
- Get GIF endpoint
- Get messages endpoint
- Get public rooms endpoint
- Get user info endpoint
- Get users info endpoint (Deprecated)
- Join room endpoint
- Signup endpoint
- Report room endpoint
- Remove room endpoint
- Update description endpoint
- Follow user endpoint
- Unfollow user endpoint
- Update icon color endpoint
- Upload content endpoint
- Upload content endpoint (Deprecated)
- Verify client endpoint
- Upload token endpoint
- Chill&chat websockets
- Message socket
- Keyboard socket
- Delete message socket
- User content
- Final words&thoughts
- Run API