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

@unitfield/connect

v0.1.0

Published

Typed, dependency-free JavaScript and TypeScript client for Unitfield Connect.

Readme

@unitfield/connect

The official, dependency-free JavaScript/TypeScript client for Unitfield Connect. It uses the platform fetch API and works in browsers, server routes, and serverless functions.

This package is ESM-only and covers the documented Connect runtime routes: organization, listings, rental applications, payments, and Checkout Sessions. Connect management routes intentionally remain API-documentation-only because they require a Unitfield user session, tenant context, and RBAC.

npm install @unitfield/connect

Browser or delegated-token usage

import { createConnectClient } from "@unitfield/connect";

const connect = createConnectClient({
  baseUrl: "https://api.unitfield.com",
  accessToken: "issued-access-token",
});

const organization = await connect.getOrganization();
const listings = await connect.listListings({ page: 1, pageSize: 20 });

The main export accepts an access token or a token provider. It never accepts or stores a confidential client credential. Keep client credentials on a trusted server and use the server entry point there:

import { createConnectClient } from "@unitfield/connect";
import { createClientCredentialsTokenProvider } from "@unitfield/connect/server";

const connect = createConnectClient({
  baseUrl: process.env.UNITFIELD_CONNECT_BASE_URL!,
  tokenProvider: createClientCredentialsTokenProvider({
    tokenUrl: process.env.UNITFIELD_AUTH_TOKEN_URL!,
    clientId: process.env.UNITFIELD_CONNECT_CLIENT_ID!,
    clientSecret: process.env.UNITFIELD_CONNECT_CLIENT_SECRET!,
    scopes: ["connect.listings.read", "connect.payments.read"],
  }),
});

Supported helpers

  • getOrganization()
  • listListings(filters?) and getListing(unitPublicId)
  • sendApplicationOtp(...), verifyApplicationOtp(...), and getApplicationDraft(...)
  • saveApplicationStep(...), uploadDraftAttachment(...), and submitApplication(...)
  • getPaymentReadiness() and getPaymentStatus(paymentPublicId)
  • createScreeningCheckoutSession(...) and createLeaseCheckoutSession(...)
  • request<T>(path, options?) for lower-level access to other runtime routes

Checkout and application-submit mutations require idempotencyKey in their request options. API failures reject with ConnectError, including the HTTP status, API code, trace/request/correlation/support fields, and available rate-limit and Retry-After metadata. An AbortError is passed through.

The checkout response clientSecret is a provider Payment Element secret for the browser checkout flow; it is not an OAuth client credential.

Licensed under the MIT License. See LICENSE.

Publishing

Authenticate to the @unitfield npm scope and publish an unused version from this directory:

npm whoami
npm publish --dry-run --access public
npm publish --access public

Run the repository-level pnpm audit and pnpm check gates first.