iachat/enterprise/app/services
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
..
captain feat: allow captain to access contact attributes (#13850) 2026-03-20 16:15:06 +05:30
cloudflare feat(cloud): Add support for viewing status of SSL in custom domains (#12011) 2025-07-30 10:52:47 -07:00
companies feat: Add company backfill migration for existing contacts (Part 1) (#12657) 2025-11-03 20:03:47 +05:30
contacts feat: Backend - Companies API endpoint with pagination and search (#12840) 2025-11-18 14:28:56 +05:30
enterprise feat: firecrawl branding api [UPM-15] (#13903) 2026-03-30 11:32:03 +05:30
internal feat: disable helpcenter on hacker plans (#12068) 2026-03-26 23:48:46 -07:00
llm fix: captain json parsing (#13708) 2026-03-05 15:43:21 +05:30
messages fix: Prevent AudioTranscriptionJob from crashing on OpenAI 401 error (#13653) 2026-02-27 14:12:03 +04:00
sla chore: fix sla email notifications (#9192) 2024-04-04 21:16:49 +05:30
twilio feat(voice): Improved voice call creation flow [EE] (#12268) 2025-08-22 13:38:23 +02:00
voice feat(enterprise): add voice conference API (#13064) 2025-12-15 15:11:59 -08:00
page_crawler_service.rb feat: Response Bot using GPT and Webpage Sources (#7518) 2023-07-21 18:11:51 +03:00