This guide explains how to publish the OpenGuardrails node to npm and the n8n community.
-
npm Account
- Create an account at https://www.npmjs.com
- Verify your email address
-
npm CLI Authentication
npm login # Enter your npm username, password, and email -
GitHub Repository
- Create repository:
openguardrails/n8n-nodes-openguardrails - Push all code to GitHub
- Create repository:
# Run linting
npm run lint
# Auto-fix linting issues
npm run lintfix
# Format code
npm run format# Install dependencies
npm install
# Build the package
npm run build
# Verify dist/ folder is created
ls -la dist/# Link the package locally
npm link
# In your n8n installation directory
cd ~/.n8n
npm link n8n-nodes-openguardrails
# Restart n8n and test the node
n8n startTest all operations:
- ✅ Check Content
- ✅ Input Moderation
- ✅ Output Moderation
- ✅ Conversation Check
- ✅ Credentials authentication
- ✅ Error handling
Update package.json version following Semantic Versioning:
- Patch (1.0.0 → 1.0.1): Bug fixes
- Minor (1.0.0 → 1.1.0): New features (backward compatible)
- Major (1.0.0 → 2.0.0): Breaking changes
# For example, release version 1.0.0
npm version 1.0.0Ensure these files are up to date:
- ✅ README.md - Installation, usage, examples
- ✅ CHANGELOG.md - Version history
- ✅ LICENSE - Apache 2.0
- ✅ package.json - Correct metadata
# Clean previous builds
rm -rf dist/
# Build fresh
npm run build# Check what will be published
npm pack --dry-run
# Review the list of files
# Make sure only necessary files are included# Publish as public package
npm publish --access publicYou should see output like:
+ n8n-nodes-openguardrails@1.0.0
- Visit https://www.npmjs.com/package/n8n-nodes-openguardrails
- Check that all information is correct
- Verify README is displayed properly
# Create and push git tag
git tag v1.0.0
git push origin v1.0.0On GitHub:
- Go to repository Releases
- Click Create a new release
- Select tag
v1.0.0 - Title:
v1.0.0 - Initial Release - Add release notes from CHANGELOG.md
- Click Publish release
The package must be live on npm before registering with n8n.
Test that users can install your node:
# In n8n Community Nodes UI
Settings → Community Nodes → Install
Enter: n8n-nodes-openguardrailsOr via CLI:
npm install n8n-nodes-openguardrails- Automatic Discovery: n8n automatically discovers npm packages with
n8n-community-node-packagekeyword - Package should appear in n8n's community node search within 24-48 hours
Once published, share on:
- n8n Community Forum: https://community.n8n.io
- n8n Discord: https://discord.gg/n8n
- Twitter/X with #n8n hashtag
- Your company blog
Ensure your package.json has these required fields:
{
"name": "n8n-nodes-openguardrails",
"version": "1.0.0",
"description": "n8n node for OpenGuardrails AI safety and content moderation",
"keywords": [
"n8n-community-node-package", // REQUIRED
"n8n",
"openguardrails",
"content moderation",
"ai safety"
],
"license": "Apache-2.0",
"homepage": "https://www.openguardrails.com",
"repository": {
"type": "git",
"url": "https://github.com/openguardrails/n8n-nodes-openguardrails.git"
},
"n8n": {
"n8nNodesApiVersion": 1,
"credentials": [
"dist/credentials/OpenGuardrailsApi.credentials.js"
],
"nodes": [
"dist/nodes/OpenGuardrails/OpenGuardrails.node.js"
]
}
}Ensure .npmignore or package.json files field includes:
Include:
dist/(compiled files)README.mdLICENSEpackage.json
Exclude:
node_modules/src/or uncompiled TypeScript.git/- Test files
.envfiles- Development configs
If this node is part of OpenGuardrails main repo, update:
## n8n Integration
Install our official n8n node:
\`\`\`bash
npm install n8n-nodes-openguardrails
\`\`\`
Or install via n8n Community Nodes UI.
[Documentation](https://github.com/openguardrails/n8n-nodes-openguardrails)Add n8n integration page to main docs site:
- Installation instructions
- Configuration guide
- Example workflows
- Video tutorial (optional)
- Watch GitHub repository for issues
- Respond to npm package issues
- Monitor n8n community forum for questions
When releasing updates:
# Create feature branch
git checkout -b feature/new-operation
# Make changes
# Commit changes
git commit -m "Add new operation"
# Push and create PR
git push origin feature/new-operation# Merge to main
git checkout main
git pull
# Bump version
npm version patch # or minor/major
# This creates a git commit and tagAdd entry for new version:
## [1.0.1] - 2025-01-XX
### Fixed
- Fixed error handling for timeout errors
### Added
- Added support for custom timeout configuration# Build
npm run build
# Publish
npm publish --access public
# Push tags
git push --tags
git push origin mainPost in:
- GitHub Releases
- n8n Community Forum
- Twitter/X
- OpenGuardrails Discord/Slack
Solution:
- Verify you're logged in:
npm whoami - Check package name isn't taken
- Use
--access publicflag
Solution:
- npm may block similar names to prevent typosquatting
- Choose a more unique name
- Contact npm support if legitimate
Solution:
- You cannot republish the same version
- Increment version:
npm version patch - Publish again
Solution:
- Check all required fields are present
- Validate with:
npm pack --dry-run - Fix package.json and try again
Solution:
- Ensure
dist/is included in package - Check
.npmignoreorfilesfield in package.json - Run
npm pack --dry-runto preview
- Version Control: Always tag releases in git
- Changelog: Keep detailed changelog
- Testing: Test locally before publishing
- Documentation: Keep README updated
- Responsiveness: Respond to issues quickly
- Backwards Compatibility: Avoid breaking changes when possible
- Security: Never include secrets in published code
- Dependencies: Keep dependencies minimal and updated
- npm Documentation: https://docs.npmjs.com/
- n8n Node Development: https://docs.n8n.io/integrations/creating-nodes/
- Semantic Versioning: https://semver.org/
- OpenGuardrails Support: thomas@openguardrails.com
When publishing to n8n community:
- Quality: Ensure node is well-tested and documented
- Maintenance: Commit to maintaining the node
- Support: Respond to user issues and questions
- Updates: Keep node compatible with latest n8n versions
- Security: Follow security best practices
- Licensing: Use permissive license (Apache-2.0, MIT)
Track your node's success:
- npm downloads: Check at https://www.npmjs.com/package/n8n-nodes-openguardrails
- GitHub stars: Watch repository stars
- Issues/PRs: Monitor community engagement
- n8n community mentions: Search in forum and Discord
Recommended maintenance tasks:
- Weekly: Check for new issues
- Monthly: Update dependencies
- Quarterly: Review and update documentation
- Yearly: Major version review
Ready to publish? Follow the checklist above and ship it! 🚀
Questions? Contact: thomas@openguardrails.com