WATCHDOG workspace

Put your business under watch.

Create your workspace or sign in to continue. Your WATCHDOG workspace is where business intelligence, obligations, alerts, and owner actions come together.

Business contextObligationsAlerts
Owner stays in control.
WATCHDOG watches. You decide.
By creating an account, you agree to the WATCHDOG Terms and acknowledge the Privacy Policy.
const eyeOpen = ''; const eyeClosed = ''; document.querySelectorAll('.password-toggle').forEach(button => { button.innerHTML=eyeOpen; button.addEventListener('click',()=>{ const input=document.getElementById(button.dataset.passwordTarget); const showing=input.type==='text'; input.type=showing?'password':'text'; button.innerHTML=showing?eyeOpen:eyeClosed; button.setAttribute('aria-label',showing?'Show password':'Hide password'); button.setAttribute('aria-pressed',String(!showing)); }); }); const API_URL = 'https://watchdog-prod.onrender.com'; const selectedPlan = new URLSearchParams(location.search).get('plan') || localStorage.getItem('watchdog.selected.plan') || ''; if(selectedPlan) localStorage.setItem('watchdog.selected.plan', selectedPlan); const TOKEN_KEY = 'watchdog.web.token'; const $ = id => document.getElementById(id); function showError(id, message){ const el=$(id); el.textContent=message; el.style.display='block'; } function clearError(id){ const el=$(id); el.textContent=''; el.style.display='none'; } async function request(path, options={}){ const token=localStorage.getItem(TOKEN_KEY); const headers={'Content-Type':'application/json',...(options.headers||{})}; if(token) headers.Authorization='Bearer '+token; const res=await fetch(API_URL+path,{...options,headers}); const text=await res.text(); let body={}; try{body=text?JSON.parse(text):{}}catch{body={error:text}}; if(!res.ok){const e=new Error(body.detail||body.error||('HTTP '+res.status));e.status=res.status;throw e} return body; } function openTab(which){ const signup=which==='signup'; $('signupPanel').style.display=signup?'block':'none'; $('loginPanel').style.display=signup?'none':'block'; $('signupTab').classList.toggle('active',signup); $('loginTab').classList.toggle('active',!signup); clearError('signupError');clearError('loginError'); } $('signupTab').onclick=()=>openTab('signup'); $('loginTab').onclick=()=>openTab('login'); $('forgotPasswordLink').onclick = (e) => { e.preventDefault(); $('forgotPasswordEmail').value = $('loginEmail').value.trim(); $('forgotPasswordPanel').style.display = 'block'; clearError('forgotPasswordError'); $('forgotPasswordSuccess').textContent = ''; $('forgotPasswordSuccess').style.display = 'none'; }; $('cancelForgotPassword').onclick = () => { $('forgotPasswordPanel').style.display = 'none'; clearError('forgotPasswordError'); $('forgotPasswordSuccess').textContent = ''; $('forgotPasswordSuccess').style.display = 'none'; }; const forgotForm = $('forgotPasswordForm'); if (forgotForm) forgotForm.addEventListener('submit', async (e) => { e.preventDefault(); clearError('forgotPasswordError'); $('forgotPasswordSuccess').textContent = ''; $('forgotPasswordSuccess').style.display = 'none'; const button = $('forgotPasswordButton'); button.disabled = true; button.textContent = 'Sending...'; try { await request('/api/auth/forgot-password', { method: 'POST', body: JSON.stringify({ email: $('forgotPasswordEmail').value.trim() }) }); $('forgotPasswordSuccess').textContent = 'If an account exists for that email, a reset link will be sent. Check your inbox and spam folder.'; $('forgotPasswordSuccess').style.display = 'block'; } catch (err) { showError( 'forgotPasswordError', 'Could not submit your request. Please try again shortly.' ); } finally { button.disabled = false; button.textContent = 'Send reset link'; } }); $('signupForm').addEventListener('submit',async e=>{ e.preventDefault(); clearError('signupError'); const btn=$('signupButton');btn.disabled=true;btn.textContent='Creating workspace…'; try{ const body={business:$('business').value.trim(),email:$('signupEmail').value.trim(),password:$('signupPassword').value}; const data=await request('/api/auth/signup',{method:'POST',body:JSON.stringify(body)}); localStorage.setItem(TOKEN_KEY,data.token); localStorage.setItem('watchdog.web.workspace',JSON.stringify(data.workspace)); window.location.href=selectedPlan?'billing.html?plan='+encodeURIComponent(selectedPlan):'dashboard.html'; }catch(err){ const msg=err.status===409?'An account with that email already exists. Try signing in.':err.message==='Failed to fetch'?'The WATCHDOG service is temporarily unavailable. Please try again.':'Could not create the workspace. '+err.message; showError('signupError',msg); }finally{btn.disabled=false;btn.textContent='Create workspace'} }); $('loginForm').addEventListener('submit',async e=>{ e.preventDefault();clearError('loginError'); const btn=$('loginButton');btn.disabled=true;btn.textContent='Signing in…'; try{ const data=await request('/api/auth/login',{method:'POST',body:JSON.stringify({email:$('loginEmail').value.trim(),password:$('loginPassword').value})}); localStorage.setItem(TOKEN_KEY,data.token); localStorage.setItem('watchdog.web.workspace',JSON.stringify(data.workspace)); window.location.href=selectedPlan?'billing.html?plan='+encodeURIComponent(selectedPlan):'dashboard.html'; }catch(err){ showError('loginError',err.status===401?'Incorrect email or password.':err.message==='Failed to fetch'?'The WATCHDOG service is temporarily unavailable. Please try again.':'Could not sign in. '+err.message); }finally{btn.disabled=false;btn.textContent='Sign in'} });