Appearance
Registry Access
@tailor-erp/kit is not on the public npm registry. It is served from Tailor's private registry at registry.tailor.tech, which authenticates every request with a Tailor Platform access token. This page covers how that token gets to pnpm on your machine and in CI. For how users sign in to your app, see Security and sign-in.
How it works
| Where | Who supplies the token |
|---|---|
| First download | You, by saving a token in your user-level ~/.npmrc before the project exists. |
| Local installs | The project's .pnpmfile.mjs, which fetches a fresh token from your Tailor login on every pnpm command. |
| CI | The erp-kit-fetch-tailor-token and erp-kit-npm-auth actions, using a machine user's credentials. |
The project's .npmrc only maps the @tailor-erp scope to the registry. It never holds a token, so it is safe to commit.
First download
Log in to Tailor Platform, then save a token to your user-level ~/.npmrc:
bash
pnpm dlx @tailor-platform/sdk login
tailor_token=$(pnpm dlx @tailor-platform/sdk auth token) &&
npm config set '//registry.tailor.tech/npm/:_authToken' "$tailor_token" --location=userThis token is only needed until the project is created. Then create the project, passing the registry for this one command:
bash
pnpm --config.@tailor-erp:registry=https://registry.tailor.tech/npm/ dlx @tailor-erp/kit init my-appLocal installs
erp-kit init generates .pnpmfile.mjs. On every pnpm command, it runs tailor auth token and hands the result to pnpm for registry.tailor.tech. As long as your Tailor login is valid, installs work without any token in a file.
- If
TAILOR_PLATFORM_TOKENis set, the hook uses it instead of your login. - In CI (
CIis set), the hook does nothing unlessTAILOR_PLATFORM_TOKENis set, so a developer login is never used there.
erp-kit init writes .pnpmfile.mjs only when the file does not exist. To add authentication to an existing pnpmfile, merge in the hook from node_modules/@tailor-erp/kit/templates/scaffold/project/.pnpmfile.mjs.
CI
The workflows ERP Kit generates authenticate before every job that installs dependencies:
erp-kit-fetch-tailor-tokenexchanges the machine user's client ID and secret for an access token.erp-kit-npm-authwrites that token to the runner's npm configuration forregistry.tailor.tech.
The credentials come from the TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID and TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET secrets. See Set up CI for where to set them.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
A pnpm command fails with Could not obtain a Tailor registry token | Your Tailor login has expired. .pnpmfile.mjs needs it on every pnpm run. | pnpm --config.ignore-pnpmfile=true dlx @tailor-platform/sdk login, then retry. |
npm view @tailor-erp/kit returns 401 | The token in ~/.npmrc has expired. pnpm refreshes its own token; npm does not. | Log in as above, then save a new token with the npm config set command from First download. |
erp-kit init returns 401 | The ~/.npmrc entry is missing, expired, or contains extra output written with the token. | Open ~/.npmrc and check that the line is exactly //registry.tailor.tech/npm/:_authToken=<token>. Remove anything else and save it again. |
App CI fails at Fetch Tailor token with No credentials provided | The secrets are set on a GitHub Environment that App CI does not read. | Set the ERP_KIT_CI_ENVIRONMENT variable. See Set up CI. |