fix video api key

This commit is contained in:
Jeff Emmett 2024-12-08 20:41:45 -05:00
parent d9fb9637bd
commit ce50366985
1 changed files with 9 additions and 2 deletions

View File

@ -99,7 +99,7 @@ export class VideoChatShape extends BaseBoxShapeUtil<IVideoChatShape> {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${import.meta.env.VITE_DAILY_API_KEY}`,
Authorization: `${import.meta.env.VITE_DAILY_API_KEY}`,
},
body: JSON.stringify({
properties: {
@ -122,8 +122,15 @@ export class VideoChatShape extends BaseBoxShapeUtil<IVideoChatShape> {
if (!response.ok) {
const errorData = (await response.json()) as DailyApiError
console.error("Daily API Error:", {
status: response.status,
statusText: response.statusText,
errorData,
})
throw new Error(
errorData.message || errorData.info || "Failed to create room",
errorData.message ||
errorData.info ||
`Failed to create room (${response.status})`,
)
}