How-to › Release and secure packages

How to reserve your package name on every registry before launch#

Hold an SDK name through namespaces on npm, NuGet, Maven, Packagist, and Go. Publish first where no namespace exists, and check each name against the registry rules.

Audience
API producer
Level
beginner
Topic
Publish to package registries
Verified

The design review signs off on quillfeather-sdk because the name is free on PyPI and crates.io that afternoon. Three weeks later the release job fails on both registries: someone else published the name first. The announcement is scheduled, and every install command in the documentation names a package you do not own.

What you get

You will end up with a launch plan that names the claim in each of seven package ecosystems, says what holds it, and fails on any name a registry would refuse. This is for you if an SDK ships to several registries under one public name.

Short answer

Hold a namespace wherever a registry offers one. That means an npm organization scope, a NuGet ID prefix, a Maven Central namespace verified by DNS, a Packagist vendor, and a Go module path on your domain. PyPI and crates.io have no reservation, so a name there is held only by publishing a real first release. Check every name against each registry’s naming and normalization rules before the announcement.

You will need

A decided public name for the SDK, and Node 22.22.2 or later, which validate-npm-package-name 8.0.0 asks for in its engines field. The checks run offline. One script, record.sh, reads five registries’ public APIs and was run once to commit what they answered.

Approaches compared

ApproachWhen it fitsWhat it costs youWhen to pick something else
NuGet ID prefix reservationYou ship to NuGet and want every later Quillfeather.* id refused to other ownersAn email request and a review against nuget.org’s criteria, with no stated turnaroundNuGet is not a target, or the prefix is a common word nuget.org declines
Organization scopes and verified namespacesThe registry has namespaces: npm scopes, Maven namespaces, Packagist vendors, Go module pathsSetup on each registry, DNS access for Maven, and a longer name in every install commandThe registry has no namespaces, as on PyPI and crates.io
Placeholder 0.0.0 releases to hold a namePyPI or crates.io, where publishing first is the only claim either registry recognizesnpm and PyPI policies call a package with no function squatting, and PEP 541 says it will be removedA namespace exists, or the real first release can ship the same week

A namespace costs setup and a longer name, but it is the one claim a registry defends for you. A NuGet prefix holds nothing until nuget.org has reviewed an emailed request against its criteria. A placeholder costs nothing to publish and holds nothing a registry has promised to respect. PEP 541 treats a package that “has no functionality or is empty” as name squatting and removes it.1 npm’s package name dispute policy treats a package with “no genuine function” as squatted too.

Write the claim list for every registry

Put the claims in one file the release job can read. This plan is for an invented SDK under the reserved example domain:

{
  "sdk": "quillfeather",
  "domains": ["quillfeather.example.com"],
  "githubOrg": "quillfeather-labs",
  "githubUser": null,
  "nugetPrefix": "Quillfeather",
  "claims": {
    "npm": "@quillfeather/sdk",
    "pypi": "quillfeather-sdk",
    "crates": "quillfeather-sdk",
    "nuget": "Quillfeather.Sdk",
    "maven": "com.example.quillfeather:quillfeather-sdk",
    "packagist": "quillfeather/sdk",
    "go": "quillfeather.example.com/sdk/go"
  }
}

The check reads each claim, applies that registry’s rules, and says what holds the name:

node plan.mjs
registry  claim                                      held by
npm       @quillfeather/sdk                          scope @quillfeather (an npm organization)
pypi      quillfeather-sdk                           nothing: first come, first served
crates    quillfeather-sdk                           nothing: first come, first served
nuget     Quillfeather.Sdk                           prefix Quillfeather.* (once nuget.org grants it)
maven     com.example.quillfeather:quillfeather-sdk  namespace com.example.quillfeather (DNS TXT record)
packagist quillfeather/sdk                           vendor quillfeather (after its first package)
go        quillfeather.example.com/sdk/go            path under quillfeather.example.com
bare names, held only by publishing first: pypi, crates

Five claims sit in a namespace. Each is held in a different way:

  • npm grants a scope with each user account and organization. Its dispute policy calls an organization squatted “if there are no packages published within a reasonable time,” and never a paid one. The same policy forbids registering an organization name “for the purposes of reserving it for future use.” Create the organization when its first package is ready to publish.
  • NuGet rejects any package whose ID matches a reserved prefix unless it comes from the owner who reserved it. Packages that others published under the prefix earlier keep their owners, who can still publish further versions. You apply by email.
  • Maven Central verifies a reversed domain through a DNS TXT record, and gives io.github.<username> to an account that signed up with GitHub.
  • Packagist protects a vendor name “once a package with that name has been published,” so the vendor is yours from its first package.
  • Go has no registry. The module path says where the code lives, so a path on your domain is a claim nobody else can make.

Check each name against the registry’s rules

A first draft usually breaks a rule somewhere. Run the same check on it:

node plan.mjs plan-draft.json
registry  claim                                      held by
npm       Quillfeather                               REFUSED: name can no longer contain capital letters
pypi      Quillfeather_SDK                           nothing: first come, first served
crates    quillfeather.sdk                           REFUSED: only ASCII letters, digits, "-" and "_"
nuget     QuillfeatherSdk                            nothing: first come, first served
maven     io.github.quillfeather-labs:sdk            REFUSED: io.github.quillfeather-labs is a GitHub organization, which Maven Central does not verify automatically
packagist Quillfeather/SDK                           REFUSED: does not match the Composer name pattern: lowercase vendor/project
go        github.com/quillfeather-labs/sdk-go        path under github.com/quillfeather-labs
bare names, held only by publishing first: pypi, nuget

Four names are refused before anyone publishes. The NuGet id is valid, but QuillfeatherSdk falls outside the Quillfeather.* prefix, so it is a bare name like the PyPI one. Maven Central’s namespace page says io.github.<github organization name> “is not available as an automatically registered namespace,” which is why the draft’s organization groupId fails.

Each rule names its source. The PyPI pattern and normalization are the packaging name normalization specification, and PyPI’s Choosing a Project Name page adds a refusal for standard library module names. The crates.io rule combines Cargo’s name field, the registry’s name validator, its reserved names, and its unique index:

// crates.io: Cargo's manifest reference allows alphanumerics, "-" and "_",
// and says crates.io adds ASCII only, no reserved names, no special Windows
// names, and 64 characters at most. crates.io's own validator
// (crates/crates_io_validation/src/lib.rs) also wants an ASCII letter first.
// Its unique index is on canon_crate_name(name), which is
// replace(lower(name), '-', '_'), and reserved names are compared the same
// way. RESERVED_CRATES is what the crates.io migrations insert into
// reserved_crate_names: Rust's own crates and the Windows device names.
const RESERVED_CRATES = new Set([
  'alloc', 'arena', 'ast', 'builtins', 'collections', 'compiler-builtins', 'compiler-rt', 'compiletest',
  'core', 'coretest', 'debug', 'driver', 'flate', 'fmt_macros', 'grammar', 'graphviz', 'macro', 'macros',
  'proc_macro', 'rbml', 'rust-installer', 'rustbook', 'rustc', 'rustc_back', 'rustc_borrowck', 'rustc_driver',
  'rustc_llvm', 'rustc_resolve', 'rustc_trans', 'rustc_typeck', 'rustdoc', 'rustllvm', 'rustuv', 'serialize',
  'std', 'syntax', 'test', 'unicode',
  'nul', 'con', 'prn', 'aux', 'com0', 'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9',
  'lpt0', 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9',
].map((n) => n.toLowerCase().replaceAll('-', '_')))
function crates(name) {
  const problems = []
  if (!/^[A-Za-z0-9_-]+$/.test(name)) problems.push('only ASCII letters, digits, "-" and "_"')
  else if (!/^[A-Za-z]/.test(name)) problems.push('must start with an ASCII letter')
  if (name.length > 64) problems.push('more than 64 characters')
  const key = name.toLowerCase().replaceAll('-', '_')
  if (RESERVED_CRATES.has(key)) problems.push('a reserved name')
  return { ok: problems.length === 0, key, problems, namespace: null }

Know which spellings are one name

Registries compare names after normalizing them, so a name that looks free in one spelling can be taken in another:

node collisions.mjs
pypi: 1 distinct name
  quillfeather-sdk    -> quillfeather-sdk
  Quillfeather_SDK    -> quillfeather-sdk
  quillfeather.sdk    -> quillfeather-sdk
  quillfeather__sdk   -> quillfeather-sdk
crates: 1 distinct name
  quillfeather-sdk    -> quillfeather_sdk
  quillfeather_sdk    -> quillfeather_sdk
  Quillfeather-SDK    -> quillfeather_sdk
nuget: 1 distinct name
  Quillfeather.Sdk    -> quillfeather.sdk
  quillfeather.sdk    -> quillfeather.sdk
  QUILLFEATHER.SDK    -> quillfeather.sdk
npm: 1 distinct name
  quillfeather-sdk    -> quillfeathersdk
  quillfeather_sdk    -> quillfeathersdk
  quillfeathersdk     -> quillfeathersdk
  Quillfeather-SDK    refused: name can no longer contain capital letters
  (npm also blocks names it detects as typosquats of popular packages, a check no client can run)

Claim the spelling you will use in documentation, and treat every other spelling with the same key as already decided.2 The npm key comes from npm’s package moniker rules, which refuse the first publish of a name without a scope that matches an existing one once dots, dashes, and underscores are removed. Its threats page adds a check against names that imitate popular packages, which no client can run.

Check it worked

The tests cover each registry’s rule, the two plans, and the lookup classification:

node --test names.test.mjs
1..17
# tests 17
# suites 0
# pass 17
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 108.416763

The live answers come from record.sh, which asked each registry twice and committed the result. The invented names answer 404 not listed, and each respelling on the right of a listed as came back as the canonical name:

cat records/availability.txt
two lookups, identical
npm       quillfeather-sdk                           404 not listed
npm       @quillfeather/sdk                          404 not listed
npm       express                                    200 taken
pypi      quillfeather-sdk                           404 not listed
pypi      requests                                   200 taken
pypi      Python.DateUtil                            200 taken, listed as python-dateutil
crates    quillfeather-sdk                           404 not listed
crates    serde                                      200 taken
crates    serde-json                                 200 taken, listed as serde_json
nuget     Quillfeather.Sdk                           404 not listed
nuget     Newtonsoft.Json                            200 taken
packagist quillfeather/sdk                           404 not listed
packagist monolog/monolog                            200 taken

A 404 not listed is a reading taken on the day of the record, never a reservation, and never proof that a name is free. PyPI’s naming page lists four reasons a name can be unavailable with no project on PyPI. The npm read of @quillfeather/sdk says nothing about who owns the scope.

When it goes wrong

The name is taken between review and launch. PyPI and crates.io offer nothing that holds a name before a release, so publish a working first version on the day the name is decided, not on launch day.

A PyPI pending publisher looks like a reservation and is not. PyPI’s trusted publisher guide says a pending publisher is invalidated when another user registers the name first. In its words, it “does not create a project or reserve a project’s name until it is actually used to publish.”

A rate-limited registry answers as if the name were missing. Count only a plain 200 or 404. The sample’s classify treats a 404 that carries Retry-After, and any other status, as unknown, never reports any answer as free, and a test holds it to both.

When not to do this

Do not publish an empty 0.0.0 package to hold a name on npm or PyPI. Both policies call it squatting, and crates.io’s policies allow its team to delete squatted crates, without notice in larger cases.

Do not spend a namespace on a registry the SDK will never ship to. A Packagist vendor or an npm organization with nothing in it is a second account to secure and a name that reads as abandoned.

Do not pick a bare dictionary word and hope. Choose a name that fits a scope or a domain you control, because those claims survive a slow design review and a bare word does not.

Do not claim the crates.io name with code you would not ship. Cargo’s publishing guide says a version can never be overwritten. The policy text in the crates.io repository lets an owner delete a crate within 72 hours of publishing it. After that, an owner can delete it only with one owner, fewer than 1000 downloads a month, and zero dependent crates.

Last verified

Verified 2026-11-30 against Node 22.23.5 and validate-npm-package-name 8.0.0. Every output block is what the command before it printed. Nothing was published and no account was created. The registry rules come from each registry’s documentation, read on the same day, and for crates.io also from the validator and migrations in its repository. The standard library list comes from Python 3.12, which record.sh ran.

Footnotes

  1. PEP 541 cites a neighbor while setting out its own rules. As the PEP reports it, npm describes its dispute policy as a “living document,” which in January 2017 prohibited name squatting. Anyone who wanted a name had to contact its author, copying npm support. The PEP became the policy that PyPI’s name retention page reproduces. ↩︎ Back to text

  2. The rule that makes serde-json and serde_json one crate is a unique index on canon_crate_name(name), created in a crates.io migration named 20150319224701_dumped_migration_94. The function it calls is one line of SQL, replace(lower($1), '-', '_'), defined in the migration filed one second earlier. ↩︎ Back to text

Read this page as markdown · All how-to guides

Generate the client instead of writing it#

Retries, timeouts, pagination and auth are the same problems in every client. Voxgig generates them from your OpenAPI description, in 23 languages, from one model.

Listen to Fireside, the Voxgig podcast

Since 2018, Richard Rodger has talked with developer advocates, event organizers, and the people who build developer-facing companies about the specifics of the work.