logo

Babylon.js Market

Members Only

Install and First Run

Download, inject, and sell assets & code on BabylonJS Market

Members Only ships as a subcommand of @babylonjsmarket/cli. Install the CLI once globally, log in once, and the bjs inject command is on your $PATH for every project you have.

Auth is mandatory. bjs inject refuses to run without a session — submissions are user-attributed and tracked server-side. If you've never used the CLI, run bjs login first; it opens your browser, you approve, the CLI gets a 7-day token.

Install

Terminal
npm install -g @babylonjsmarket/cli

That installs the CLI and exposes the bjs bin. bjs inject is the publishing subcommand; the rest of bjs (login, whoami, download, …) is documented separately.

Log in

Terminal
bjs login

bjs login opens your default browser, walks you through OAuth on babylonjsmarket.com, and writes a 7-day session token to ~/.bjs/config.json. After that, every bjs subcommand — including bjs inject — uses that token automatically.

You'll know it worked when:

Terminal
bjs whoami
# you@example.com

Confirm the subcommand is wired up

Terminal
which bjs
# /Users/you/.npm-global/bin/bjs  (or wherever your npm prefix points)

bjs inject --help

If which returns nothing, your npm global bin directory isn't on $PATH. Run npm config get prefix to see where global packages are installed, and add <prefix>/bin to $PATH. This is an npm-side problem, not a Members Only problem.

The full help text

text
Usage: bjs inject [OPTION]... NAME...

Submit a component or system to BabylonJS Market for curator review.
Reads your project's src/components/<Name>/, runs the same closure walk
and rewrites as the reverse of arcade eject, and ships the resulting
diff to the marketplace API. No writes happen to the local library —
the work runs in a tmpdir.

With no --target, the tool auto-detects per seed:
  * any file extending PanelDebuggerSystem / StateStepperSystem or
    importing from @babylonjsmarket/viz → viz,
  * otherwise → arcade.

Multi-seed inputs must all detect to the same target.

Options:
  --target <arcade|viz>           skip auto-detection
  --source <path>                 override <cwd>/src/components/<Name>/
  --layer <core|solid|ecs>        viz only; skip per-file layer detection
  --force                         allow overwriting an existing target
  --dry-run                       print the plan, write nothing, no API call
  -h, --help                      print this help message

Examples:
  bjs inject Foo                              # auto-detect target, submit
  bjs inject Foo Bar --dry-run                # multi-name, preview only
  bjs inject MyPanelDebugger --target viz
  bjs inject Foo --source ./packages/demo/src/components/Foo

That's the entire member-facing surface. No subcommands beyond bjs inject, no config file.

First run: a dry-run against a sample

A dry-run prints the plan, writes nothing, and makes no API call. It's how you confirm the tool found the right target before any submission is recorded.

Terminal
cd my-project
bjs inject Bouncer --dry-run

You'll see something like:

text
Inject plan (dry run — nothing submitted):
  target:     arcade
  components: Bouncer
  + src/components/Bouncer/
  patched registry: Bouncer

Re-run without --dry-run to submit.

Three signals to read for:

  • target: — which library namespace the tool chose. If it's not what you expected, pass --target explicitly, and read target selection to understand the heuristic.
  • components: — the closure. If your seed pulls in a sibling you didn't list, that sibling is here. If it pulls in something you didn't expect, follow the ../Sibling/ import that brought it in.
  • The + lines — every file that would be submitted, and every registry/barrel patch.

When everything looks right, drop --dry-run:

Terminal
bjs inject Bouncer

You'll see the same plan with Inject plan replaced by Submitting: and a confirmation at the end with a submission ID:

text
Submitting:
  target:     arcade
  components: Bouncer
  + src/components/Bouncer/
  patched registry: Bouncer

Submitted as #142 (status: pending).
Track it at https://babylonjsmarket.com/account/submissions/142

A curator picks it up from there. You don't need to do anything else.

Members don't need a local library checkout

bjs inject runs in a tmpdir, computes the diff against an in-memory view of the library layout, and ships the resulting file map + patches to the marketplace API. You do not need the arcade or viz library tree on your machine.

That's a deliberate departure from earlier versions of this guide. The CLI used to write directly into a sibling checkout; that flow is now operator-only. Members go through the API.

What's next

The next section, anatomy of a component, walks through the file shape bjs inject expects.

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search