-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b497c7
commit 455b09e
Showing
2 changed files
with
67 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
//create meeting -->meeting id | ||
const axios = require('axios').default; | ||
|
||
const DYTE_API_Meeting_URL = 'https://api.dyte.io/v2/meetings'; | ||
const DYTE_API_Adding_URL = `https://api.dyte.io/v2 | ||
/meetings/{meeting_id}/participants`; | ||
|
||
const DYTE_API_TOKEN = `${process.env.ORG_ID}:${process.env.API_KEY}`; | ||
|
||
async function createDyteMeeting(title) { | ||
try { | ||
const response = await axios.post( | ||
DYTE_API_Meeting_URL, | ||
{ | ||
title: `${title}`, | ||
preferred_region: 'ap-south-1', | ||
record_on_start: false, | ||
live_stream_on_start: false | ||
}, | ||
{ | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Basic ${DYTE_API_TOKEN}` | ||
} | ||
} | ||
); | ||
|
||
return response.data.id; | ||
} catch (error) { | ||
console.error('Error creating Dyte meeting:', error); | ||
throw error; | ||
} | ||
} | ||
|
||
// Example usage: | ||
const meetingTitle = 'My Dyte Meeting'; | ||
createDyteMeeting(meetingTitle) | ||
.then(meetingId => { | ||
console.log('Created Dyte Meeting with ID:', meetingId); | ||
}) | ||
.catch(error => {}); | ||
|
||
//add participant -->auth token |