js
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer apikey`,
"Content-Type": "application/json"
}
});
if (!response.ok) throw new Error(`Error: ${response.statusText}`);
const data = await response.json();
console.log(data.robloxId);
userProfile.robloxID = data.robloxId
await userProfile.save()
} catch (error) {
console.error("Failed to get Roblox ID:", error);
return null;
}
}
js
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer apikey`,
"Content-Type": "application/json"
}
});
if (!response.ok) throw new Error(`Error: ${response.statusText}`);
const data = await response.json();
console.log(data.robloxId);
userProfile.robloxID = data.robloxId
await userProfile.save()
} catch (error) {
console.error("Failed to get Roblox ID:", error);
return null;
}
}