Common issues and solutions when using the Gately SDK.

Authentication Issues

Login/Signup Not Working

Session Management Issues

SSO Issues

OAuth Popup Problems

Mobile SSO Issues

UI Control Issues

Elements Not Showing/Hiding

React Integration Issues

Hook Not Working

Performance Issues

Slow Authentication

Development Environment Issues

Local Development

Error Debugging

Enable Debug Logging

// Enable detailed logging
const gately = new GatelyBrowserClient('project-id', {
  debug: true
})

// Manual logging
gately.onAuthStateChange((user, session) => {
  console.log('Auth state change:', {
    user: user ? { id: user.id, email: user.email } : null,
    session: session ? { expires_at: session.expires_at } : null,
    timestamp: new Date().toISOString()
  })
})

Network Debugging

// Monitor network requests
const originalFetch = window.fetch
window.fetch = function(...args) {
  console.log('Fetch request:', args[0])
  return originalFetch.apply(this, args)
    .then(response => {
      console.log('Fetch response:', response.status, args[0])
      return response
    })
    .catch(error => {
      console.error('Fetch error:', error, args[0])
      throw error
    })
}

Getting Help

Before Contacting Support

  1. Check the Console: Look for error messages in browser developer tools
  2. Verify Configuration: Double-check project ID and domain settings
  3. Test in Incognito: Rule out browser extension conflicts
  4. Try Different Browser: Check if issue is browser-specific
  5. Check Network: Verify internet connection and firewall settings

Information to Include

When contacting support, include:
  • Project ID (without sensitive data)
  • Browser and version
  • Operating system
  • Error messages from console
  • Steps to reproduce the issue
  • Expected vs actual behavior

Debug Information Script

// Run this script to gather debug information
function gatherDebugInfo() {
  const info = {
    userAgent: navigator.userAgent,
    url: window.location.href,
    cookiesEnabled: navigator.cookieEnabled,
    localStorageAvailable: typeof Storage !== 'undefined',
    isAuthenticated: gately.isAuthenticated(),
    user: gately.getUser() ? 'Present' : 'Null',
    session: gately.getSession() ? 'Present' : 'Null',
    timestamp: new Date().toISOString()
  }
  
  console.log('Debug Info:', JSON.stringify(info, null, 2))
  return info
}

// Call when experiencing issues
gatherDebugInfo()

Next Steps