Sign In

@cross-deck/cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cross-deck/cli

Crossdeck CLI — upload source maps so production stack traces resolve back to original file:line:function.

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
41
-93.91%
Maintainers
1
Weekly downloads
 
Created
Source

@cross-deck/cli

Upload source maps to Crossdeck so production stack traces resolve back to original file:line:function references on the dashboard.

npm install -D @cross-deck/cli
# or one-shot:
npx @cross-deck/cli upload-sourcemaps \
  --release v1.2.3 \
  --url-prefix https://app.example.com/static/js/ \
  ./dist

What it does

After your bundler runs, your ./dist directory holds a bunch of minified .js files alongside .js.map companions. Browsers run the .js; the .map translates a minified line:column back to your original source — but only if Crossdeck can find it.

This CLI walks ./dist, pairs every .js with its .map via the trailing //# sourceMappingURL= comment, and ships the maps to the Crossdeck backend. The next error event from production then renders as src/checkout/Pay.tsx:114 — handleSubmit instead of main.a1b2c3.js:1:48202.

Source maps stay private — they're stored in private Cloud Storage and never served to dashboard clients. Only resolved frames go out.

Authentication

The CLI needs a Crossdeck secret key (cd_sk_test_… or cd_sk_live_…). Get one at /dashboard/developers/api-keys/.

Pick one of:

# Recommended for CI: set once, every command inherits.
export CROSSDECK_AUTH_TOKEN=cd_sk_live_…

# Or pass per-invocation:
crossdeck upload-sourcemaps --auth-token cd_sk_live_… …

Publishable keys (cd_pub_…) are rejected — source maps reveal original source code, so they need server-only credentials.

Configuration

SourceNotes
CROSSDECK_AUTH_TOKENSecret key. Required.
CROSSDECK_PROJECT_IDOptional — backend infers from the key.
CROSSDECK_BASE_URLDefaults to https://api.cross-deck.com.

CLI flags --auth-token / --project / --base-url always override env vars.

Bundler setup

Your bundler needs to emit external .map files with sourcesContent inlined:

BundlerConfig
Vite / Rollupbuild: { sourcemap: true }
Webpackdevtool: 'source-map'
ESBuildsourcemap: true, sourcesContent: true
Next.jsproductionBrowserSourceMaps: true
TurbopackSource maps are emitted by default in Next 14+.

Avoid devtool: 'eval-source-map' and devtool: 'inline-source-map' for production builds — those embed the map in the bundle and can't be uploaded separately.

Usage in CI

GitHub Actions:

- name: Build
  run: npm run build
- name: Upload source maps
  env:
    CROSSDECK_AUTH_TOKEN: ${{ secrets.CROSSDECK_AUTH_TOKEN }}
  run: |
    npx @cross-deck/cli upload-sourcemaps \
      --release ${{ github.sha }} \
      --url-prefix https://app.example.com/static/js/ \
      ./dist

Vercel (in package.json):

{
  "scripts": {
    "build": "next build",
    "postbuild": "crossdeck upload-sourcemaps --release $VERCEL_GIT_COMMIT_SHA --url-prefix https://$VERCEL_URL/_next/ ./.next/static"
  }
}

The release identifier is whatever you want — semver, commit SHA, build number. Keep it consistent with the release field your app emits via Crossdeck.init({ appVersion: '…' }).

How it works

  • Walks the dist directory; finds every .js / .mjs / .cjs file.
  • Reads the trailing //# sourceMappingURL= comment of each bundle.
  • Resolves the comment's path against the bundle's directory.
  • Builds the runtime URL: {urlPrefix}{relativePath}.
  • Chunks the discovered pairs into batches of ≤100 files.
  • POSTs each batch to /v1/releases/sourcemaps with the secret key.

Files without a sourceMappingURL comment, with an inline data-URI map, or with a missing companion .map are skipped (use --verbose to see why).

Exit codes

CodeMeaning
0All maps uploaded successfully (or no maps to upload — empty dir is not a fail)
1Upload error (network / auth / per-file rejection)
2Argument / flag validation error

Privacy

Source maps are sensitive — they reveal original source code, including function names, variable names, file paths, and comments. Crossdeck stores them in private Cloud Storage with the same access posture as your customer database. Only resolved frames (the post-decode file:line references) ever leave the backend; the raw map content is never exposed to the dashboard or any client.

License

MIT

Keywords

crossdeck

FAQs

Package last updated on 13 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts