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/nifb-vrsync-client

v1.0.0

Published

Client HTTP tipado pra consumir a API do horizon-integrations-hub (rotas /api/providers/nifb-vrsync/v1/*). Instalado nos sites das imobiliárias pra puxar imóveis do feed NIFB via hub, preservando Anti-Corruption Layer.

Readme

@horizon-integrations/nifb-vrsync-client

Client HTTP tipado pra consumir a API do horizon-integrations-hub (rotas /api/providers/nifb-vrsync/v1/*). Instalado nos sites das imobiliárias pra puxar imóveis do feed NIFB via hub — preservando Anti-Corruption Layer (DDD).

Arquitetura

┌────────────────────┐        ┌──────────────────┐        ┌───────────────┐
│ Site Horizon       │  HTTP  │ hub              │  HTTP  │ Feed NIFB XML │
│ @horizon-          │───────▶│ @horizon-        │───────▶│ (público)     │
│ integrations/      │        │ integrations/    │        │               │
│ nifb-vrsync-client │        │ nifb-vrsync      │        │               │
└────────────────────┘        └──────────────────┘        └───────────────┘

Site consome só o client (este pacote, leve). Hub consome o runtime (@horizon-integrations/nifb-vrsync). Client e runtime são pacotes separados — sem bloat no bundle do site.

Instalação

pnpm add @horizon-integrations/nifb-vrsync-client

Uso básico

import { NifbVrsyncClient } from "@horizon-integrations/nifb-vrsync-client"

const nifb = new NifbVrsyncClient({
  baseUrl: process.env.HUB_URL!,              // https://hub.horizonintegrations.com
  authToken: process.env.HUB_TOKEN!,          // x-api-key do hub
  tenantConfig: {                             // opcional — feed é público
    filter: {
      excludeIds: ["31", "237"],
      includeCities: ["FRANCISCO BELTRAO"],
    },
  },
})

// Streaming de imóveis
for await (const property of nifb.properties.streamAll()) {
  await db.properties.upsert(property)
}

// Listing leve — só refs + PublishDate único do feed
const { index } = await nifb.properties.getListing()

// Validar conectividade (hub + feed)
const check = await nifb.check()
if (!check.ok) throw new Error(check.message)

Delta via sync_hash

Records vêm com sync_hash (SHA-256 truncado). Pra detectar mudanças sem re-inserir tudo:

for await (const p of nifb.properties.streamAll()) {
  const existing = await db.properties.findUnique({ where: { reference: p.reference } })
  if (existing?.sync_hash === p.sync_hash) continue   // sem mudança
  await db.properties.upsert({
    where: { reference: p.reference },
    create: p,
    update: p,
  })
}

Por que sync_hash em vez de source_updated_at? NIFB tem único PublishDate pra todo o feed (ver NIFB-001 no manifest do runtime) — não dá pra comparar timestamp individual. O hash resolve isso.

Capabilities

nifb.capabilities.individualFetch   // false — sem fetchByRef
nifb.capabilities.writes.sendLead   // false — feed é read-only
nifb.capabilities.pagination        // false — feed é atômico
nifb.capabilities.nativeTimestamp   // true — PublishDate do header

Limitações documentadas

Ver knownIssues do manifest runtime (@horizon-integrations/nifb-vrsync@^2.0.0):

  • NIFB-001 — sem timestamp por record (use sync_hash)
  • NIFB-002 — feed atômico (sem fetchByRef, sem paginação)
  • NIFB-003 — feed pode conter múltiplas imobiliárias (use filter)

Relacionado