async function existsUser(userCode){ const response = await fetch("/api/existsUser", { method: "POST", headers: { "Content-Type": "application/json", "X-App-Token": chatToken }, body: JSON.stringify({ user_code: userCode }) }); if (!response.ok) { const errorData = await response.json().catch(() => ({ message: "Respuesta no vĂ¡lida del servidor." })); throw new Error(errorData.message || `Error del servidor: ${response.status}`); } const data = await response.json(); return data; } export { existsUser};