npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@horizon-integrations/si9-crm

v3.2.0

Published

Integração da Imobland Horizon com a SI9 CRM

Downloads

866

Readme

@horizon-integrations/si9-crm

Integracao completa com o CRM SI9 Sistemas para a plataforma Horizon.

🔴 BREAKING — v3.0.0 (2026-05-13): SI9 reescreveu a API. Auth agora é API Key (não mais OAuth2), e a base URL mudou. Veja seção Migração v2 → v3 abaixo. A API antiga (api.si9sistemas.com.br/imobilsi9-api) está descontinuada e retorna 400 "You have to use the new version of this api!".

O que faz

  • Baixa imoveis da API SI9 v2 (PropertyDownloader)
  • Converte do formato SI9 para o formato Horizon (convertSi9PropertyToHorizon)
  • Envia leads para o CRM SI9 (sendLead, sendLeadFromForm)

Instalacao

pnpm add @horizon-integrations/si9-crm

Uso rapido

Converter imoveis (SI9 -> Horizon)

import { fetchAll, convertSi9PropertyToHorizon } from "@horizon-integrations/si9-crm"

// 1. Baixar e converter TODOS os imoveis (em memoria)
const { properties, errors } = await fetchAll({
  credentials: {
    apiKey: process.env.SI9_API_KEY!,
  },
})

// 2. Ou converter manualmente um imovel raw
const horizonProperty = convertSi9PropertyToHorizon(imovelSi9Raw)

v1.4.0+: fetchAll() e getListing() são puros em memória — ideais pra APIs serverless. O legado PropertyDownloader#downloadAll() continua disponível pra scripts locais que gravam JSON em disco.

Enviar leads (forma recomendada v1.3.0+)

import { sendLeadFromForm } from "@horizon-integrations/si9-crm"

const result = await sendLeadFromForm(formData, formMeta, {
  apiKey: process.env.SI9_API_KEY!,
})

// result: { success: true, platform: "si9", leadId: 527 }

O sendLeadFromForm:

  • Normaliza campos via adaptGenericLead do lead-core
  • Monta observation formatada com buildObservation (mensagem + dados do form + metadados + UTMs)
  • Mapeia property_ref -> propertyId, property_operation -> interestedIn
  • Trata string[], labels bonitos, papa-tudo automatico
  • Qualquer campo novo no formulario vai pra observation sem precisar mexer no pacote

Enviar leads (baixo nivel)

import { sendLead } from "@horizon-integrations/si9-crm"

const result = await sendLead({
  name: "Joao Silva",
  email: "[email protected]",
  phone: "(46) 99999-0001",
  message: "Tenho interesse neste imovel",
  propertyId: 855,
  propertyOperation: "venda",
}, { apiKey: process.env.SI9_API_KEY! })

API SI9 v2

  • Base URL: https://apiv2.si9sistemas.com.br/api-prd
  • Auth: X-Api-Key: Bearer <token> (API Key tenant-scoped, sem expiração)
  • Imoveis: GET /property (suporta filtros como situation=D, lastUpdate=YYYY-MM-DD)
  • Lead: POST /lead (upsert por phone/email)
  • Docs oficiais: https://apiv2.si9sistemas.com.br/api-prd/integration-guide.md
  • Swagger UI: https://apiv2.si9sistemas.com.br/api-prd/docs

Gerar a API Key

Painel SI9 → Configurações → API Keys → criar token com permissões:

  • LIST_IMOVEIS — obrigatório (GET /property e GET /property/{id})
  • LIST_LEADS — opcional (GET /lead)
  • CADASTRAR_LEADS — opcional (writers de lead)

Migração v2 → v3

| Antes (v2.x) | Agora (v3.x) | |---|---| | credentials: { username, password, authorization } | credentials: { apiKey } | | https://api.si9sistemas.com.br/imobilsi9-api | https://apiv2.si9sistemas.com.br/api-prd | | POST /oauth/token + Bearer cacheado | Header X-Api-Key: Bearer <apiKey> direto | | Token TTL 3599s, refresh automático | Sem expiração | | ENV: SI9_USERNAME / SI9_PASSWORD / SI9_AUTHORIZATION | ENV: SI9_API_KEY |

Endpoints públicos (GET /property, GET /property/{id}, POST /lead) mantêm path. Apenas auth e host mudaram.

Documentacao detalhada

Dependencias

  • @horizon-js/lead-core — Tipagem universal e adapter de leads
  • @horizon-js/property-domain-schema — Schema base de imoveis Horizon