Skip to main content

🟢 Node.js example

import crypto from 'node:crypto';
import axios from 'axios';

const ENDPOINT = 'https://bbb.example.com/bigbluebutton/api';
const SECRET = 'YOUR_SHARED_SECRET';

async function main() {
// 1) Query string for create (checksum uses ONLY the query)
const params = new URLSearchParams({
name: 'Demo with Overrides',
meetingID: 'demo-123',
attendeePW: 'ap',
moderatorPW: 'mp',
allowOverrideClientSettingsOnCreateCall: 'true',
});
const query = params.toString();

// 2) checksum = sha1('create' + query + secret)
const checksum = crypto.createHash('sha1')
.update('create' + query + SECRET)
.digest('hex');

const url = `${ENDPOINT}/create?${query}&checksum=${checksum}`;

// 3) JSON override in CDATA
const override = {
public: {
app: { appName: 'Greenlight', helpLink: 'greenlight.example.com' },
defaultSettings: {
application: { autoJoin: true, askForConfirmationOnLeave: false },
user: { userSettingsStorage: 'sessionStorage', application: { overrideLocale: 'en' } },
},
},
};

const xmlBody =
`<modules><module name="clientSettingsOverride"><![CDATA[${JSON.stringify(override)}]]></module></modules>`;

// 4) POST it
const { data } = await axios.post(url, xmlBody, {
headers: { 'Content-Type': 'application/xml' },
timeout: 30000,
});

console.log(data); // XML response
}

main().catch(err => {
console.error(err);
process.exit(1);
});