Provide a seamless way for end users to link their merchant accounts to your web app.
Please see https://docs.knotapi.com/ for installation instructions.
git clone https://github.com/millionscard/knotapi-js.git
cd knotapi-js
cp .env.example .env
`Copy values in the 1Password into
.envInstall packages and start
`
yarn
yarn start
`Releasing a New Version
To create a new release:
1. Create a release branch with the version number:
`bash
git checkout -b release/X.Y.Z
`
(e.g., release/1.0.7)2. Update the version in
package.json following semantic versioning:
- Patch version (1.0.6 → 1.0.7) for bug fixes
- Minor version (1.0.6 → 1.1.0) for new features
- Major version (1.0.6 → 2.0.0) for breaking changes3. Commit and push the version change:
`bash
git add package.json
git commit -m "chore: bump version to X.Y.Z"
git push origin release/X.Y.Z
`4. Merge the release branch to
main (via pull request or directly):
`bash
git checkout main
git merge release/X.Y.Z
git push origin main
`5. Create and push a git tag from the main branch:
`bash
git tag vX.Y.Z
git push origin vX.Y.Z
`6. GitHub Actions will automatically:
- Generate a changelog from merged PRs
- Create a GitHub Release with the changelog
- Run tests
- Publish the package to npm
The release workflow is triggered by pushing a tag, so make sure the tag matches the version in
package.json.$3
If the GitHub Actions workflow fails with an npm authentication error (e.g., "npm ERR! code E401" or "npm ERR! 401 Unauthorized"), the npm token may have expired. Follow these steps to create a new token and update the secret:
1. Create a new npm access token:
- Go to npmjs.com and log in
- Click on your profile → Access Tokens (or go directly to https://www.npmjs.com/settings/YOUR_USERNAME/tokens)
- Click Generate New Token → Automation (or Classic Token with "Automation" type)
- Copy the token immediately (you won't be able to see it again)
2. Update the GitHub secret:
- Go to the repository on GitHub
- Navigate to Settings → Secrets and variables → Actions
- Find the
NODE_AUTH_TOKEN secret
- Click Update and paste the new token
- Save the changes3. Re-run the failed workflow:
- Go to the Actions tab
- Find the failed workflow run
- Click Re-run all jobs (or re-run the specific failed job)
Alternatively, you can push the tag again to trigger a new release workflow:
`bash
git push origin vX.Y.Z --force
``