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

@bara-agency/dotloop-sdk

v0.2.0

Published

Server-side TypeScript SDK for the Dotloop Public API v2.

Readme

@bara-agency/dotloop-sdk

Server-side TypeScript SDK for the Dotloop Public API v2.

Node.js >=20 only. Keep clientId, clientSecret, and tokens on the server — never ship them to the browser.

Install

npm install @bara-agency/dotloop-sdk

Quick start

import { DotloopClient } from "@bara-agency/dotloop-sdk";

const client = new DotloopClient({
  clientId: process.env.DOTLOOP_CLIENT_ID!,
  clientSecret: process.env.DOTLOOP_CLIENT_SECRET!,
  refreshToken: process.env.DOTLOOP_REFRESH_TOKEN!,
});

const account = await client.account.get();

for await (const page of client.loops.iterate(profileId, { batchSize: 100 })) {
  console.log(page.data.length);
}

The SDK refreshes access tokens on 401 (once, under a refresh lock) and retries idempotent GET/DELETE failures with exponential backoff. Pass credentials explicitly — the package does not read env vars itself.

OAuth helpers

import { DotloopClient } from "@bara-agency/dotloop-sdk";

const url = DotloopClient.getAuthorizationUrl({
  clientId,
  redirectUri: "https://app.example/callback",
  state: "csrf-token",
});

// After the user consents:
await client.exchangeCode({
  code,
  redirectUri: "https://app.example/callback",
});

Shared token store (multi-instance)

import {
  DotloopClient,
  createMemoryTokenStore,
  type TokenStore,
} from "@bara-agency/dotloop-sdk";

const tokenStore: TokenStore = createMemoryTokenStore();
// Or implement get/set/withRefreshLock against Redis/DB.

const client = new DotloopClient({
  clientId,
  clientSecret,
  refreshToken,
  tokenStore,
});

Webhook signature verification

import { verifyWebhookSignature } from "@bara-agency/dotloop-sdk";

verifyWebhookSignature({
  body: rawBodyString,
  signature: request.headers["x-dotloop-signature"]!,
  timestamp: request.headers["x-dotloop-timestamp"]!,
  signingKey,
});

Throws DotloopWebhookVerificationError on invalid or stale signatures.

Resources

account, profiles, loops, loopDetails, folders, documents, participants, tasks, activities, contacts, templates, loopIt, webhooks.subscriptions, webhooks.events.

Escape hatch for untyped or custom calls: client.request<T>(path, method?, body?).

Optional Postgres store (@bara-agency/dotloop-sdk/db)

The Dotloop API cannot search Loops by structured parameters. The optional db subpath ships a typed Postgres store (migrations + CRUD/search) so you can sync Loops and Profiles locally and query them yourself. The root entry stays dependency-free — pg is an optional peer dependency you inject.

import { createDotloopStore } from "@bara-agency/dotloop-sdk/db";

const store = createDotloopStore({ db: pool }); // your pg Pool/Client
await store.migrate();

await store.profiles.upsertMany(profiles);
await store.loops.upsertMany(loops); // loops need profileId set

const rows = await store.loops.search({
  status: ["Active", "Under Contract"],
  updatedAfter: "2026-07-01T00:00:00.000Z",
  nameContains: "maple",
  limit: 50,
});

createDotloopSync({ client, store }) keeps the store current: sync() mirrors all profiles and loops from the API (opt-in prune), and ingestWebhook(payload) applies a webhook delivery (loop/profile lifecycle events, idempotent, fetches the current resource per event).

The same subpath ships a Postgres-backed token store for multi-instance deploys — plug it into the client's existing tokenStore option and OAuth refresh tokens (e.g. from exchangeCode in your integrated app) persist in the database:

import { createPostgresTokenStore } from "@bara-agency/dotloop-sdk/db";

const client = new DotloopClient({
  clientId,
  clientSecret,
  tokenStore: createPostgresTokenStore({ db: pool }), // key defaults to "default"
});

Refreshes serialize across instances via a Postgres advisory lock. Full schema and API reference: docs/database-layer.md.

Design

See docs/superpowers/specs/2026-07-29-dotloop-sdk-design.md.

Publishing (maintainers)

Releases publish via GitHub Actions (.github/workflows/publish.yml) using npm trusted publishing (OIDC). No NPM_TOKEN secret is required.

Trusted Publisher (already configured on npmjs.com for @bara-agency/dotloop-sdk):

| Field | Value | |-------|-------| | Organization | baraagency | | Repository | dotloop-sdk | | Workflow filename | publish.yml (filename only — must match exactly) |

To publish a new version

  1. Bump version in package.json (and commit).
  2. Create a GitHub Release (preferred) or run the Publish workflow manually (workflow_dispatch).
  3. The workflow authenticates via OIDC — do not set NODE_AUTH_TOKEN / NPM_TOKEN on the publish step.

This repository is private, so npm will not attach provenance attestations (a known limitation for private source repos). That is expected; the publish still succeeds.