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

scorimmo-node

v0.1.0

Published

Official Scorimmo SDK for Node.js — API client & webhook handler

Readme

scorimmo-node

Official Node.js / TypeScript SDK for the Scorimmo real-estate CRM platform.

Simplifies integration of Scorimmo leads into your CRM in two ways:

  • API client — fetch, create and update leads with automatic JWT token management
  • Webhook handler — receive and dispatch Scorimmo events in Express

Requirements

  • Node.js ≥ 18
  • TypeScript (optional but recommended)

Installation

npm install scorimmo-node
# or
yarn add scorimmo-node

API Client

import { ScorimmoClient } from 'scorimmo-node'

const client = new ScorimmoClient({
  baseUrl: 'https://app.scorimmo.com',
  username: 'your-api-username',
  password: 'your-api-password',
})

// Fetch all leads created in the last 24h (handles pagination automatically)
const since = new Date(Date.now() - 24 * 60 * 60 * 1000)
const leads = await client.leads.since(since)

// Get a single lead
const lead = await client.leads.get(42)

// Search leads
const result = await client.leads.list({
  search: { external_lead_id: 'CRM-001' },
  order: 'desc',
  limit: 20,
  page: 1,
})

// Create a lead
const created = await client.leads.create({
  store_id: 1,
  interest: 'TRANSACTION',
  customer: { first_name: 'Marie', last_name: 'Dupont', phone: '0600000001' },
  properties: [{ type: 'Appartement', price: 250000 }],
})

// Update a lead (e.g. store your CRM id)
await client.leads.update(created.id, { external_lead_id: 'CRM-456' })

The client handles JWT authentication automatically and refreshes the token before expiry.


Webhook Handler

Configure a webhook URL on your Scorimmo Point of Sale, then receive events in your Express app:

import express from 'express'
import { ScorimmoWebhook } from 'scorimmo-node'

const app = express()
app.use(express.json())

const webhook = new ScorimmoWebhook({
  headerKey: 'X-Scorimmo-Key',       // header configured in Scorimmo PoS settings
  headerValue: process.env.SCORIMMO_WEBHOOK_SECRET,
})

app.post('/webhook/scorimmo', ...webhook.middleware(), async (req, res) => {
  await webhook.dispatch(req.scorimmo, {
    onNewLead: async (lead) => {
      // Full lead object — create in your CRM
      await yourCRM.contacts.create(lead)
    },
    onUpdateLead: async ({ id, ...changes }) => {
      await yourCRM.contacts.update(id, changes)
    },
    onNewRdv: async ({ lead_id, start_time, location }) => {
      await yourCRM.appointments.create({ lead_id, start_time, location })
    },
    onClosureLead: async ({ lead_id, status, close_reason }) => {
      await yourCRM.contacts.archive(lead_id, { status, close_reason })
    },
  })
  res.sendStatus(200)
})

Webhook events

| Event | Trigger | Key fields | |-------|---------|------------| | new_lead | Lead created in Scorimmo | Full lead object | | update_lead | Lead updated | id, changed fields only | | new_comment | Comment added to a lead | lead_id, comment | | new_rdv | Appointment created | lead_id, start_time, location, detail | | new_reminder | Reminder created | lead_id, start_time, detail | | closure_lead | Lead closed | lead_id, status, close_reason |


Error handling

import { ScorimmoApiError, ScorimmoAuthError } from 'scorimmo-node'

try {
  const lead = await client.leads.get(999)
} catch (err) {
  if (err instanceof ScorimmoApiError) {
    console.error(err.message, err.statusCode) // e.g. "Lead not found", 404
  }
  if (err instanceof ScorimmoAuthError) {
    console.error('Check your API credentials')
  }
}
import { WebhookAuthError, WebhookValidationError } from 'scorimmo-node'
// These are thrown by webhook.parse() and caught automatically by webhook.middleware()

Framework-agnostic usage

Don't use Express? Use parse() and dispatch() directly:

// Works with Fastify, Hono, plain Node http, etc.
const event = webhook.parse(request.headers, request.body)
await webhook.dispatch(event, { onNewLead: ... })

Examples

See the examples/ directory:


License

MIT