video debug
This commit is contained in:
parent
ce50366985
commit
6e1e03d05b
|
|
@ -94,12 +94,19 @@ export class VideoChatShape extends BaseBoxShapeUtil<IVideoChatShape> {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Ensure API key exists and is properly formatted
|
||||||
|
const apiKey = import.meta.env.VITE_DAILY_API_KEY?.trim()
|
||||||
|
if (!apiKey) {
|
||||||
|
throw new Error("Daily API key is missing")
|
||||||
|
}
|
||||||
|
|
||||||
// Create room using Daily.co API directly
|
// Create room using Daily.co API directly
|
||||||
const response = await fetch(`https://api.daily.co/v1/rooms`, {
|
const response = await fetch(`https://api.daily.co/v1/rooms`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: `${import.meta.env.VITE_DAILY_API_KEY}`,
|
// Ensure no extra spaces in the Authorization header
|
||||||
|
Authorization: `Bearer ${apiKey}`.trim(),
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
properties: {
|
properties: {
|
||||||
|
|
@ -126,6 +133,7 @@ export class VideoChatShape extends BaseBoxShapeUtil<IVideoChatShape> {
|
||||||
status: response.status,
|
status: response.status,
|
||||||
statusText: response.statusText,
|
statusText: response.statusText,
|
||||||
errorData,
|
errorData,
|
||||||
|
authHeader: `Bearer ${apiKey.substring(0, 5)}...`, // Log first 5 chars for debugging
|
||||||
})
|
})
|
||||||
throw new Error(
|
throw new Error(
|
||||||
errorData.message ||
|
errorData.message ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue