This guide details the steps to publish the web agent to the public NPM registry.
- NPM Account: You must have an account on npmjs.com.
- Organization: You must create an organization named senzops on NPM (since the package is scoped @senzops/web).
- Go to NPM -> Click Profile Picture -> + Add Organization.
- Name it senzops.
In your terminal, inside the web-agent folder:
npm loginFollow the browser prompts to authenticate.
Ensure the code is clean, dependencies are installed, and the build passes.
npm installnpm run buildUpdate the version number in package.json. You should follow Semantic Versioning (Major.Minor.Patch).
- Patch (Bug fix): 1.0.0 -> 1.0.1
- Minor (New feature): 1.0.0 -> 1.1.0
- Major (Breaking change): 1.0.0 -> 2.0.0
You can do this manually or use the npm command:
npm version patch
# or
npm version minorBecause this is a scoped package (@senzops/...), NPM tries to publish it as private by default (which requires a paid account). To publish it as public (free), you must use the access flag.
Run this command:
npm publish --access public- Go to https://www.npmjs.com/package/@senzops/web.
- Check if the version matches the one you just pushed.
- Check the dist/ files are included in the "Code" tab.
If you are hosting the script via a CDN (like jsDelivr or unpkg), they usually pick up the new NPM version automatically within a few minutes.
- Unpkg: https://unpkg.com/@senzops/web@latest/dist/index.global.js
- jsDelivr: https://cdn.jsdelivr.net/npm/@senzops/web@latest/dist/index.global.js
You can map your custom domain cdn.senzor.dev to one of these URLs via CNAME records.