library for bigbluebutton
npm install s-bigbluebuttonJavaScript layer to interact with BigBlueButton API. Supports WebHooks.
bash
npm i s-bigbluebutton
`
Usage
You will need to provide BigBlueButton URL and secret to the script. You can obtain them by logging into you BBB server, and running:
`bash
bbb-conf --secret
`
Use the obtained values in your script:
`javascript
const bbb = require('s-bigbluebutton')
let api = bbb.api(
process.env.BBB_URL,
process.env.BBB_SECRET
)
`
Examples
The following example shows how to create a room, and links for moderator and attendee to join:
`javascript
const bbb = require('s-bigbluebutton')
// BBB_URL and BBB_SECRET can be obtained
// by running bbb-conf --secret on your BBB server
// refer to Getting Started for more information
let api = bbb.api(
process.env.BBB_URL,
process.env.BBB_SECRET
)
// api module itself is responsible for constructing URLs
let meetingCreateUrl = api.administration.createMeeting('My Meeting', '1', {
duration: 2,
attendeePW: 'secret',
moderatorPW: 'supersecret',
})
// http method should be used in order to make calls
api.httpClientCall(meetingCreateUrl).then((result) => {
console.log(result)
let moderatorUrl = api.administration.joinMeeting('moderator', '1', 'supersecret')
let attendeeUrl = api.administration.joinMeeting('attendee', '1', 'secret')
console.log(Moderator link: ${moderatorUrl}\nAttendee link: ${attendeeUrl})
let meetingEndUrl = api.administration.endMeeting('1', 'supersecret')
console.log(End meeting link: ${meetingEndUrl})
})
``