Featurebase Messenger Integration

Featurebase Messenger Integration

https://help.featurebase.app/en/collections/3118494-in-app-widgets

SPEC: Migração Crisp + Canny → Featurebase

Objetivo: Substituir Crisp (chat ao vivo) e Canny (feedback) por Featurebase Messenger


Resumo Executivo

Migração completa de duas ferramentas legadas:

  • Crisp → Featurebase Messenger (chat ao vivo + suporte)
  • Canny → Featurebase Portal (feedback + roadmap + changelog)
  • Linear Integration → Nativa do Featurebase (substitui pipeline customizada)

Arquitetura

ANTES:                              DEPOIS:
┌──────────────┐  ┌─────────┐      ┌─────────────────────────────┐
│ Crisp Widget │  │  Canny  │      │   Featurebase Messenger     │
│ (Chat)       │  │ (Link)  │      │ (Chat + Feedback + Portal)  │
└──────┬───────┘  └─────────┘      └─────────────┬───────────────┘
       │                                         │
       ▼                                         ▼ (Nativo)
┌──────────────────────┐                   ┌──────────┐
│ Pipeline Customizada │                   │  Linear  │
│ - webhook.ts         │                   └──────────┘
│ - widget-action.ts   │
│ - cron job           │
└──────────┬───────────┘
           ▼
     ┌──────────┐
     │  Linear  │
     └──────────┘

Fases de Implementação

Fase 1: Completar Featurebase ✅ (parcialmente feito)

| Status | Arquivo | Ação | | -- | -- | -- | | ✅ | src/components/support/featurebase-widget.tsx | Já criado | | ✅ | supabase/functions/featurebase-messenger-jwt/ | Já criado | | ⏳ | src/components/dashboard-wrapper.tsx | Adicionar <FeaturebaseWidget /> no JSX | | ⏳ | supabase/config.toml | Declarar featurebase-messenger-jwt | | ⏳ | .env.example | Documentar VITE_FEATUREBASE_APP_ID |

Fase 2: Remover Crisp

Arquivos para DELETAR:

| Arquivo | Linhas | Descrição | | -- | -- | -- | | src/components/support/crisp-widget.tsx | 123 | Widget frontend | | api/crisp/widget-action.ts | 807 | Handler manual | | api/crisp/webhook.ts | 627 | Webhook handler | | api/cron/crisp-bugs-to-linear.ts | 898 | Cron (desabilitado) | | api/lib/crisp/constants.ts | 185 | Constantes | | __tests__/components/support/crisp-widget.test.tsx | ~100 | Testes widget | | __tests__/api/lib/crisp/constants.test.ts | ~100 | Testes constantes | | api/cron/crisp-bugs-to-linear.test.ts | ~100 | Testes cron | | docs/crisp-to-linear.md | *

| Documentação | | .claude/skills/crisp/SKILL.md | *

| Skill Claude |

Arquivos para MODIFICAR:

| Arquivo | Mudança | | -- | -- | | src/components/dashboard-wrapper.tsx | Remover import CrispWidget, usar FeaturebaseWidget | | src/contexts/auth-context.tsx | Remover import/chamadas de resetCrispSession | | package.json | Remover crisp-sdk-web e scripts crisp:* | | .env.example | Remover seção Crisp |

Fase 3: Remover Canny

| Arquivo | Mudança | | -- | -- | | src/components/app-sidebar.tsx | Trocar link pluma-finance.canny.iofeedback.pluma.finance |

Fase 4: Banco de Dados

Recomendado: Manter tabela crisp_processed_conversations como histórico

ALTER TABLE crisp_processed_conversations
RENAME TO legacy_crisp_conversations;

Fase 5: Variáveis de Ambiente

| Ação | Variável | Local | | -- | -- | -- | | ❌ Remover | VITE_CRISP_WEBSITE_ID | Vercel | | ❌ Remover | CRISP_IDENTIFIER | Vercel | | ❌ Remover | CRISP_KEY | Vercel | | ❌ Remover | CRISP_SIGNING_SECRET | Vercel | | ✅ Verificar | FEATUREBASE_JWT_SECRET | Supabase (já existe) | | ✅ Verificar | FEATUREBASE_PORTAL_URL | Supabase (já existe) | | ➕ Adicionar | VITE_FEATUREBASE_APP_ID | Vercel |

Valores:

  • VITE_FEATUREBASE_APP_ID = 68b875d3f0d1b7dbae80ebab
  • FEATUREBASE_JWT_SECRET = fb-2c734568-d645-4970-a4c6-418e7c1d871a
  • FEATUREBASE_PORTAL_URL = https://feedback.pluma.finance

Checklist de Verificação

Pre-deploy

  • [ ] npm run build sem erros
  • [ ] npm test passando
  • [ ] npm run lint:fix limpo

Post-deploy

  • [ ] Widget Featurebase aparece no dashboard
  • [ ] Usuário identificado no chat (email, nome)
  • [ ] Tema dark/light sincronizado
  • [ ] Link "Melhorias e Feedbacks" abre Featurebase Portal
  • [ ] SSO funciona (login automático no portal)
  • [ ] Feedback aparece no Linear (integração nativa)

Riscos e Mitigação

| Risco | Probabilidade | Mitigação | | -- | -- | -- | | Widget não carrega | Média | Verificar VITE_FEATUREBASE_APP_ID no console | | SSO falha | Baixa | Verificar FEATUREBASE_JWT_SECRET no Supabase | | Linear não recebe | Baixa | Verificar config no painel Featurebase |


Dependências

  • Featurebase SDK: https://do.featurebase.app/js/sdk.js (carregado dinamicamente)
  • Supabase Edge Functions: featurebase-messenger-jwt, sso-featurebase

Rollback

  1. Reverter PR
  2. Re-habilitar env vars do Crisp no Vercel
  3. Banco não é alterado (tabela mantida como legacy)
Upvoters
Status

Completed

Board
💡

Feature Request

Date

25 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.