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() {
const params = new URLSearchParams({
name: 'Demo with Overrides',
meetingID: 'demo-123',
attendeePW: 'ap',
moderatorPW: 'mp',
allowOverrideClientSettingsOnCreateCall: 'true',
});
const query = params.toString();
const checksum = crypto.createHash('sha1')
.update('create' + query + SECRET)
.digest('hex');
const url = `${ENDPOINT}/create?${query}&checksum=${checksum}`;
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>`;
const { data } = await axios.post(url, xmlBody, {
headers: { 'Content-Type': 'application/xml' },
timeout: 30000,
});
console.log(data);
}
main().catch(err => {
console.error(err);
process.exit(1);
});