iachat/enterprise/app/services/enterprise
Shivam Mishra 7651c18b48
feat: firecrawl branding api [UPM-15] (#13903)
Adds `WebsiteBrandingService` (OSS) with an Enterprise override using
Firecrawl v2 to extract branding and business data from a URL for
onboarding auto-fill.

OSS version uses HTTParty + Nokogiri to extract:
- Business name (og:site_name or title)
- Language (html lang)
- Favicon
- Social links from `<a>` tags

Enterprise version makes a single Firecrawl call to fetch:
- Structured JSON (name, language, industry via LLM)
- Branding (favicon, primary color)
- Page links

Falls back to OSS if Firecrawl is unavailable or fails.

Social handles (WhatsApp, Facebook, Instagram, Telegram, TikTok, LINE)
are parsed deterministically via a shared `SocialLinkParser`.

> We use links for socials, since the LLM extraction was unreliable,
mostly returned empty, and hallucinated in some rare scenarios

## How to test

```ruby
# OSS (no Firecrawl key needed)
WebsiteBrandingService.new('chatwoot.com').perform

# Enterprise (requires CAPTAIN_FIRECRAWL_API_KEY)
WebsiteBrandingService.new('notion.so').perform
WebsiteBrandingService.new('postman.com').perform
```

Verify the returned hash includes business_name, language,
industry_category, social_handles, and branding with
favicon/primary_color.

<img width="908" height="393" alt="image"
src="https://github.com/user-attachments/assets/e3696887-d366-485a-89a0-8e1a9698a788"
/>
2026-03-30 11:32:03 +05:30
..
auto_assignment fix: Enforce team boundaries to prevent cross-team assignments (#13353) 2026-02-16 14:39:20 +05:30
billing fix: skip pay call if invoice already paid after finalize (#13924) 2026-03-30 10:37:28 +05:30
contacts feat: outbound voice call essentials (#12782) 2025-11-24 17:47:00 -08:00
conversations feat: Add support for search_conversations in copilot (#11520) 2025-05-20 19:22:17 -07:00
message_templates fix: Captain not responding to campaign conversations (#13489) 2026-02-12 10:07:56 +05:30
action_service.rb feat: Conversation update API for sla_policy_id (#8973) 2024-03-14 17:22:32 +05:30
clearbit_lookup_service.rb feat: account onboarding with clearbit (#8857) 2024-02-12 23:21:42 +05:30
search_service.rb feat: Advanced Search Backend (#12917) 2026-01-07 15:30:49 +05:30
website_branding_service.rb feat: firecrawl branding api [UPM-15] (#13903) 2026-03-30 11:32:03 +05:30