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

@vansite/ts-sharetribe-flex-sdk

v3.1.1

Published

This is a TypeScript SDK for Sharetribe Flex API. It reduces the complexity of the API and provides a more user-friendly interface.

Readme

@vansite/ts-sharetribe-flex-sdk

npm version TypeScript MIT License

A fully-typed TypeScript SDK for the Sharetribe Flex API. It wraps both the Marketplace API and the Integration API in a single, lightweight package — with built-in token management, Transit serialization, and the same code path for Node.js and the browser.

Features

  • Two SDKs, one packageSharetribeSdk (client/marketplace) and IntegrationSdk (server/backend)
  • Cross-platform — identical code in Node.js and the browser, no loader needed
  • Fully typed — complete definitions generated from the official Sharetribe reference, including per-endpoint request params and include-aware response shapes
  • Complete API coverage — Marketplace, Integration, Authentication and Asset Delivery APIs, incl. the file-sharing endpoints
  • Built-in token management — pluggable token stores (memory, browser cookie, Express)
  • Transit-aware — transparent serialization of UUID, Money, LatLng, BigDecimal, …
  • Tree-shakeable — ships ESM, CJS and a UMD browser bundle

Installation

npm install @vansite/ts-sharetribe-flex-sdk
# or: pnpm add … / yarn add …

Quick Start

import { SharetribeSdk, IntegrationSdk, sdkTypes } from "@vansite/ts-sharetribe-flex-sdk";

const { UUID, Money, LatLng } = sdkTypes;

// --- Marketplace (client-side / browser) ---
const sdk = new SharetribeSdk({ clientId: "your-client-id" });

const { data } = await sdk.listings.query({
  keywords: "yoga",
  price: "1000,10000", // range "min,max" in minor units (cents)
  include: ["author", "images"],
});

// --- Integration (server-side only) ---
const integrationSdk = new IntegrationSdk({
  clientId: "your-client-id",
  clientSecret: "your-client-secret", // never expose in the browser
});

await integrationSdk.users.show({ id: new UUID("user-id") });

Money is in minor units (e.g. cents). Always wrap typed values in sdkTypes (UUID, Money, LatLng, LatLngBounds, BigDecimal) so they serialize correctly.

API Coverage & Documentation

Both APIs are covered end-to-end. See the per-area guides in docs/:

| Guide | Contents | |-------|----------| | Getting Started | Setup, configuration, first requests | | Marketplace API | Listings, users, transactions, messages, reviews, file sharing, Stripe, … | | Integration API | Privileged listing/user/transaction ops, events, files & attachments, stock | | Authentication | Token grants, login/logout, IdP, token exchange | | Token Stores | MemoryStore, BrowserStore, ExpressStore | | Transit Serialization | How SDK types map to Transit | | SDK Types | UUID, Money, LatLng, LatLngBounds, BigDecimal | | Examples | End-to-end recipes |

Asset Delivery API is exposed directly on the SDK: sdk.assetByAlias, sdk.assetsByAlias, sdk.assetByVersion, sdk.assetsByVersion.

Token Management

Tokens are persisted through a pluggable store (a MemoryStore is used by default):

import { SharetribeSdk, TokenStores } from "@vansite/ts-sharetribe-flex-sdk";

// Express: store the refresh token in a secure, httpOnly cookie
const sdk = new SharetribeSdk({
  clientId: "your-client-id",
  tokenStore: new TokenStores.ExpressStore({ clientId: "your-client-id", req, res, secure: true, httpOnly: true }),
});

| Store | Use case | |-------|----------| | MemoryStore | Default; scripts, tests, short-lived processes | | BrowserStore | Single-page apps (browser cookies) | | ExpressStore | Server apps; pair with httpOnly: true in production |

Module Formats

Published in three formats (resolved automatically via the exports field):

| Format | File | Entry | |--------|------|-------| | ES Module | dist/index.mjs | import | | CommonJS | dist/index.js | require | | UMD / Browser | dist/index.umd.js | global TsSharetribeFlexSdk |

Changelog

3.1.1

  • Docs: fixed the listings.query price filter example — it's a range string "min,max" in minor units, not a { gte, lte } object
  • Docs: list yarn and npm alongside pnpm for the dev commands

3.1.0

  • Marketplace file-sharing endpoints: files, fileUploads, fileDownloads, ownFiles, ownFileDownloads
  • Integration query endpoints: messages, files, fileAttachments
  • integrationSdk.users.verifyEmail

Migration from sharetribe-flex-sdk

SDK Loader

The SDK loader is no longer needed — there is no difference between the Node and web builds.

// before
import { types as sdkTypes } from "./sdkLoader";
// after
import { sdkTypes } from "@vansite/ts-sharetribe-flex-sdk";
const { Money } = sdkTypes;

Transit

// before: import { transit } from "./sdkLoader";
// after:
import { transit } from "@vansite/ts-sharetribe-flex-sdk";

const serialize = (data) => transit.write(data, { typeHandlers, verbose: config.sdk.transitVerbose });
const deserialize = (str) => transit.read(str, { typeHandlers });

Token Stores

// before
const store = require("sharetribe-flex-sdk").tokenStore.memoryStore();
// after
const { TokenStores } = require("@vansite/ts-sharetribe-flex-sdk");
const store = new TokenStores.MemoryStore();

Development

Works with pnpm, yarn or npm:

pnpm install   # yarn install      | npm install
pnpm build     # yarn build        | npm run build    — bundles (CJS/ESM/UMD) + types
pnpm test      # yarn test         | npm test         — Jest test suite
pnpm analyze   # yarn analyze      | npm run analyze  — bundle size analysis

Contributing

Contributions are welcome! Please use the standard GitHub flow (fork → branch → pull request). Bug reports, feature requests, expanded test coverage and documentation improvements are all appreciated.

License

MIT — see LICENSE.


Tags: Sharetribe Flex · TypeScript SDK · Marketplace API · Integration API · Node.js · Browser