📚 Quick checklist

⚡ Quick Integration Checklist

External Company Ticket System Integration

Version: 1.0
For: New Partner Companies
Time Required: 15-30 minutes


🎯 Pre-Integration Checklist

Company Setup

  • Contact Flare99 support team
  • Receive tenant slug (e.g., yourcompany)
  • Receive API endpoint URL
  • Optional: Request custom subdomain
  • Add your domain to CORS whitelist (if using AJAX)

Technical Prerequisites

  • Website uses HTTPS (required)
  • Have user authentication system
  • Can access frontend code (JavaScript/HTML)
  • Can identify logged-in users (email + name)

📝 Implementation Steps

Step 1: Expose User Data (5 min)

  • Add code to footer/header template
  • Expose window.authUser with email and name
  • Test in browser console: console.log(window.authUser)

Quick Code:

<script>
    window.authUser = {
        email: '{{ user.email }}',
        name: '{{ user.name }}'
    };
</script>

Step 2: Add Support Function (5 min)

  • Copy contactSupport() function from guide
  • Replace yourcompany with your tenant slug
  • Test function exists: console.log(typeof contactSupport)

Quick Code:

function contactSupport(e, openInNewTab = true) {
    if (e) e.preventDefault();
    const user = window.authUser;
    if (!user?.email) {
        alert('Please sign in first.');
        return;
    }
    
    const form = document.createElement('form');
    form.method = 'POST';
    form.action = 'https://tickets.flare99.com/api/auth/redirect/YOURSLUG';
    form.target = openInNewTab ? '_blank' : '_self';
    
    ['email', 'name'].forEach(field => {
        const input = document.createElement('input');
        input.type = 'hidden';
        input.name = field;
        input.value = user[field] || '';
        form.appendChild(input);
    });
    
    document.body.appendChild(form);
    form.submit();
    form.remove();
}

Step 3: Add Button/Link (2 min)

  • Add clickable element in navigation/footer
  • Use onclick="contactSupport(event)"
  • Test click triggers function

Quick Code:

<a href="#" onclick="contactSupport(event)">Submit Ticket</a>

Step 4: Test Integration (10 min)

  • Test as logged-out user (should show login prompt)
  • Test as logged-in user (should redirect to ticket system)
  • Verify user auto-logged in to ticket system
  • Try creating a test ticket

✅ Validation Tests

Browser Console Tests

// Test 1: User data exists
console.log('User:', window.authUser);
// Expected: {email: "user@example.com", name: "John Doe"}

// Test 2: Function exists
console.log('Function:', typeof contactSupport);
// Expected: "function"

// Test 3: Manual trigger (same tab)
contactSupport(null, false);
// Expected: Form submits and redirects

Network Tab Tests

  1. Open DevTools (F12) → Network tab
  2. Click "Submit Ticket"
  3. Look for POST to tickets.flare99.com
  4. Check Request Payload has email and name

End-to-End Test

  1. User logged out → Click button → Redirected to login
  2. User logged in → Click button → Opens ticket system
  3. User auto-authenticated in ticket system
  4. Can view dashboard
  5. Can create ticket successfully

🐛 Common Issues & Quick Fixes

Issue Quick Fix
window.authUser is undefined Check if user authentication code is in template
Button does nothing Check browser console for JavaScript errors
CORS error Use Form POST method OR contact us for whitelist
User not auto-logged in Verify email matches exactly, check cookies enabled
Token expired Tokens valid 2 minutes, ensure page is fresh

📋 Integration Methods Comparison

Method Difficulty User Experience CORS Required
Form POST ⭐ Easy Page reload/new tab ❌ No
AJAX/Fetch ⭐⭐ Medium Seamless (no reload) ✅ Yes
postMessage ⭐⭐⭐ Advanced Complex scenarios ✅ Yes

Recommendation: Start with Form POST (easiest, no CORS needed)


📞 Quick Support

Integration Issues: integration@flare99.com
Technical Support: support@flare99.com
Emergency: +1-XXX-XXX-XXXX


🎯 Success Criteria

Your integration is complete when:

✅ Logged-out users see login prompt
✅ Logged-in users redirect to ticket system
✅ Users auto-authenticated without re-login
✅ Users can create tickets successfully
✅ Session persists across page reloads


📚 Additional Resources

  • Full Documentation: EXTERNAL_COMPANY_INTEGRATION_GUIDE.md
  • Code Examples: See guide for Laravel, WordPress, React examples
  • API Reference: Full API documentation in main guide
  • Testing Guide: Comprehensive testing procedures in main guide

Need help? Contact integration@flare99.com with:

  1. Your company name
  2. Tenant slug received
  3. Description of issue
  4. Screenshots of console errors (if any)

Estimated completion time: 15-30 minutes for basic integration 🚀