
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
yarn add tingz-sdk
Import the SDK and initialize.
import Tingz from 'tingz-sdk'
// Controller
const tingz = new Tings(APP_API_KEY)
// Scene Player
const tingz = new Tingz(APP_API_KEY, { isServer: true })
This SDK handles user authentication and communication between a controller app and it's scene player counterpart.
Communication is acheived through the send()
and receive()
functions.
send()
accepts a JSON object which is send to the receive()
function in an apps other half.
tingz.send({ action: 'START', payload: { id: 123 } })
tingz.receive((data) => {
console.log(data) // { action: 'START', payload: { id: 123 } }
})
tingz.getMeetingUserList((userList) => {
console.log(userList) // [ { id, isHost, username }, {...}, {...} ]
})
tingz.getMeetingUserHost((userHost) => {
console.log(userHost) // { id, isHost, username }
})
tingz.changeMeetingUserHost(userId, (wasUpdated) => {
// userIds can be obtained for example from tingz.getMeetingUserList()
// Use this method to change the host user of the Tingz meeting room.
console.log(wasUpdated) // Boolean
})
Events can be listened to through the on()
function.
Event | Description |
---|---|
ready | SDK initialization complete |
message | Incoming message |
userConnected | User connected to Tingz meeting room |
userDisconnected | User disconnected from Tingz meeting room |
meetingHostUpdated | Tingz meeting room host user was changed |
// On app initialization. `ready`
tingz.on('ready', () => console.log('App is ready!'))
// On incoming message. Same as `receive()`. `message`
tingz.on('message', (data) => console.log('Message', data))
// On user has connected to Tingz meeting room event
tingz.on('userConnected', (user) => console.log('User connected', user))
// On user has disconnected from Tingz meeting room event
tingz.on('userDisconnected', (user) => console.log('User disconnected', user))
// On meeting host user has been changed inside Tingz meeting room
tingz.on('meetingHostUpdated', (hostUser) => console.log('Meeting host user', hostUser))
A user object is exposed with the following properties:
Key | Type | Description |
---|---|---|
id | String | Unique ID of the current user |
username | String | Username of the current user |
isHost | Boolean | true is current user is the meeting host |
FAQs
## How to use
The npm package tingz-sdk receives a total of 0 weekly downloads. As such, tingz-sdk popularity was classified as not popular.
We found that tingz-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.