Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@37signals/basecamp

Latest version: v0.40.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: bitsweat, dhh, flavorjones, jorgemanrubia, packagethief, rosapolis, samuelpecher
53 Stars
11 Forks
28 Versions
15.3K Downloads
Go Repo language

Scan summary

@37signals/basecamp was last scanned on 29 Nov 2026 at version 0.40.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 28 versions; the latest was published on 29 Nov 2026.
  • Findings: No rules fired in version 0.40.0.
  • Downloads: 15,255 downloads.

Versions

28 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.40.0 LATEST 29 Nov 2026 No rules fired
0.39.0 22 Nov 2026 No rules fired
0.38.0 20 Nov 2026 No rules fired
0.36.0 12 Nov 2026 Not shown
0.35.0 5 Nov 2026 Not shown

No rules fired in 0.40.0

Findings

Findings for v0.40.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.40.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Basecamp TypeScript SDK

npm version TypeScript Test

Official TypeScript SDK for the Basecamp API.

Upgrading to v0.14.0? Read MIGRATING.md before you bump the version. The compiler catches the uploads.listVersions retype and any exhaustive handling of the widened ErrorCode union; what it will not catch is a non-exhaustive branch on "api_error", which storage, project and webhook limit failures no longer reach — they now report "limit_exceeded". Coming from v0.12.0 or earlier, read v0.13.0's section too.

Features

  • Full type safety with TypeScript generics
  • 30+ services covering the complete Basecamp API
  • OAuth 2.0 with PKCE support
  • ETag-based HTTP caching (opt-in)
  • Automatic retry with exponential backoff
  • Pagination helpers for large result sets
  • Observability hooks for logging, metrics, and tracing
  • OpenTelemetry integration

Installation

npm install @37signals/basecamp

Requires Node.js 22.12+ and TypeScript 5.0+.

Getting a token

Every Basecamp API request carries an OAuth 2.0 access token. There is no API key and no personal access token, so even a throwaway script starts here:

  1. Choose the grant that matches how your code runs:
Your integration Grant Who refreshes the token
already holds a token you obtained elsewhere static token — Token Providers you do
can receive a browser redirect (web app, or a local callback server) authorization code + PKCE — Manual Authorization Flow, or Interactive Login for a CLI your accessToken function, which the SDK re-invokes per request
has no browser, but a person can approve on another device (CLI, headless server, TV) device flow — Device flow your accessToken function, which the SDK re-invokes per request

The one-line rule: a redirect URI you control → authorization code; no browser but someone to approve → device flow; a token already in hand → static token. An unattended daemon or CI job fits none of the three on its own — the device flow needs a person to enter the user code at the verification URI — so provision a token out of band and hand it to the process as a static or refresh token.

  1. Get the client credentials that grant needs:
  • Authorization code + PKCE — register your own integration at https://launchpad.37signals.com/integrations. You get a client ID, a client secret, and whatever redirect URI you nominated.
  • Device flow — nothing to register. It runs as the pre-registered public basecamp-cli client, which sends no secret, against the device endpoint that discovery returns. Launchpad advertises no device endpoint, so a client you register there is not the one this flow uses.
  • Static token — nothing to register; you already hold the token.

A bare accessToken string is never refreshed — once it expires every call fails with 401 until you supply a new one. Use it to get a first successful call, then pass an async token provider or an AuthStrategy before you ship.

Finding your account ID

Every API path is scoped to an account — https://3.basecampapi.com/{accountId}/… — so createBasecampClient needs that number before your first call. One token can reach several accounts, so ask the token which. getInfo() addresses Launchpad by default, which is right for a Launchpad-issued token; a device-flow token is issued by the discovered BC5 server, so pass that issuer as the endpoint option:

import { createBasecampClient } from "@37signals/basecamp";

const token = process.env.BASECAMP_TOKEN!;

// createBasecampClient always requires an accountId, but authorization.getInfo()
// talks to Launchpad rather than the account-scoped API, so a placeholder is fine
// for the bootstrap call.
const bootstrap = createBasecampClient({ accountId: "0", accessToken: token });

// "bc3" is Basecamp; the unfiltered response also carries "hey" and other products.
// endpoint defaults to Launchpad, which is right for a Launchpad-issued token.
// For a device-flow token, pass the discovered issuer:
//   { filterProduct: "bc3", endpoint: `${issuer}/authorization.json` }
const info = await bootstrap.authorization.getInfo({ filterProduct: "bc3" });
for (const account of info.accounts) {
  console.log(`${account.id}: ${account.name}`);
}

// Rebuild with the real account ID — that is the client you keep.
const client = createBasecampClient({
  accountId: String(info.accounts[0].id),
  accessToken: token,
});

info.expiresAt is a Date telling you how long the token has left, which is the quickest way to confirm a static token has not lapsed.

Quick Start

import { createBasecampClient } from "@37signals/basecamp";

const client = createBasecampClient({
  accountId: process.env.BASECAMP_ACCOUNT_ID!,
  accessToken: process.env.BASECAMP_TOKEN!,
});

// List all projects
const projects = await client.projects.list();
for (const project of projects) {
  console.log(`${project.id}: ${project.name}`);
}

Configuration

Client Options
import { createBasecampClient } from "@37signals/basecamp";

const client = createBasecampClient({
  // Required
  accountId: "12345",
  accessToken: "your-token", // or async token provider

  // Optional
  baseUrl: "https://3.basecampapi.com/12345", // default
  userAgent: "my-app/1.0",
  enableCache: true, // ETag caching (default: false)
  enableRetry: true, // Auto retry 429 and 503 (default: true)
  hooks: myHooks, // Observability hooks
});
Token Providers

For simple use cases, pass a static token string:

const client = createBasecampClient({
  accountId: "12345",
  accessToken: "your-access-token",
});

For token refresh scenarios, pass an async function:

const client = createBasecampClient({
  accountId: "12345",
  accessToken: async () => {
    // Fetch or refresh your token
    const token = await myTokenStore.getValidToken();
    return token.accessToken;
  },
});

OAuth 2.0

The SDK includes utilities for implementing OAuth 2.0 with automatic PKCE negotiation. PKCE parameters are included only when the server's discovery metadata advertises code_challenge_methods_supported: ["S256"] (per RFC 8414 and RFC 7636).

Interactive Login (CLI / Desktop)

performInteractiveLogin handles the full flow — discovery, PKCE negotiation, local callback server, browser launch, code exchange, and token storage:

import { performInteractiveLogin } from "@37signals/basecamp";
import open from "open";

const token = await performInteractiveLogin({
  clientId: CLIENT_ID,
  clientSecret: CLIENT_SECRET,
  store: myTokenStore,
  openBrowser: (url) => open(url),
  onStatus: (msg) => console.log(msg),
});
Manual Authorization Flow

For web apps or custom flows, use the lower-level helpers directly:

import {
  discoverLaunchpad,
  buildAuthorizationUrl,
  generatePKCE,
  generateState,
  exchangeCode,
  refreshToken,
  isTokenExpired,
} from "@37signals/basecamp";

// 1. Discover OAuth endpoints
const config = await discoverLaunchpad();

// 2. Generate PKCE (only if the server supports S256) and state
const supportsPKCE = config.codeChallengeMethodsSupported?.includes("S256") ?? false;
const pkce = supportsPKCE ? await generatePKCE() : undefined;
const state = generateState();

// Store pkce?.verifier and state in session for later

// 3. Build authorization URL
const authUrl = buildAuthorizationUrl({
  authorizationEndpoint: config.authorizationEndpoint,
  clientId: CLIENT_ID,
  redirectUri: REDIRECT_URI,
  state,
  pkce,
});
// Redirect user to authUrl.toString()

// 4. Exchange code for tokens (in callback handler)
const token = await exchangeCode({
  tokenEndpoint: config.tokenEndpoint,
  code: callbackParams.code,
  redirectUri: REDIRECT_URI,
  clientId: CLIENT_ID,
  clientSecret: CLIENT_SECRET,
  codeVerifier: pkce?.verifier,
  useLegacyFormat: true, // Required for Basecamp Launchpad
});

// 5. Refresh when expired
if (isTokenExpired(token)) {
  const newToken = await refreshToken({
    tokenEndpoint: config.tokenEndpoint,
    refreshToken: token.refreshToken!,
    useLegacyFormat: true,
  });
}
Resource-first discovery (BC5)

BC5 serves its Authorization Server metadata only at its canonical issuer (the web host), so discovery starts from the resource (RFC 9728) and composes with AS discovery (RFC 8414):

import { discoverFromResource, DiscoverySelectionError } from "@37signals/basecamp";

const result = await discoverFromResource("https://3.basecampapi.com");
if (result.kind === "selected") {
  // result.config is bound + validated for result.issuer
} else {
  // result.reason is "resource_discovery_failed" | "no_as_advertised"
  // → fall back to Launchpad (discoverLaunchpad())
}

performInteractiveLogin supports this via resourceBaseUrl (mutually exclusive with the legacy baseUrl; supplying both is a usage error):

await performInteractiveLogin({
  clientId: "basecamp-cli",
  store: myTokenStore,
  resourceBaseUrl: "https://3.basecampapi.com",
  expectedIssuer, // optional: authoritative, non-heuristic selection
  openBrowser: (url) => open(url),
});

Selection. With expectedIssuer (production canonical: https://app.basecamp.com), the advertised member equal by code-point is selected (else a hard expected_issuer_unavailable). Without it, the SDK uses a documented Basecamp-profile heuristic: exactly one non-Launchpad issuer → selected; ≥2 → hard ambiguous_issuers (never guesses); zero → Launchpad.

Pass bare origins — no trailing slash. Binding is code-point exact, and the failure mode depends on which parameter carries the slash: a trailing-slash expectedIssuer fails the advertised-member lookup and throws a hard expected_issuer_unavailable, while a trailing-slash resource origin breaks the hop-1 resource binding and silently soft-falls back to Launchpad.

Fallback is allowed only before a first-party issuer is committed. Once valid resource metadata advertises it and it is selected, every later failure is fatal — the SDK never silently falls back to Launchpad:

Failure Result
Hop-1 fetch/parse fails, or resource mismatch soft resource_discovery_failed → Launchpad
Valid metadata omits the first-party issuer soft no_as_advertised → Launchpad
≥2 non-Launchpad issuers (no expectedIssuer) throws ambiguous_issuers
expectedIssuer not advertised throws expected_issuer_unavailable
Committed issuer origin invalid throws invalid_issuer_origin
Committed AS metadata fetch fails throws as_fetch_failed
Committed issuer binding mismatch throws issuer_mismatch

Hard cases throw DiscoverySelectionError (with a .reason); soft cases return a { kind: "fallback", reason }.

Breaking-ish: OAuthConfig.authorizationEndpoint is now optional — device-only servers omit it. Authorization-code consumers must assert it before use (performInteractiveLogin does this and errors if it is missing). Both discovery hops are SSRF-hardened (HTTPS-only origins, suppressed redirects, bounded body reads).

Device flow (RFC 8628)

For CLIs and headless/remote environments, use the device authorization grant with the public basecamp-cli client (no secret). performDeviceLogin takes an already-selected config, guards the device capability, shows the user code via a display hook, and polls for the token:

The device authorization endpoint lives on the first-party authorization server, not Launchpad — so select a first-party issuer with discoverFromResource and hand its config to performDeviceLogin. (Launchpad advertises no device endpoint, so performDeviceLogin's capability guard rejects it with DeviceFlowError("unavailable").)

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @37signals/basecamp

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229