nevermined-payments-n8n-node

n8n community node for Nevermined Payments - Integrate AI monetization and crypto/fiat payment processing into your n8n workflows

Package Information

Downloads: 0 weekly / 4 monthly
Latest Version: 1.0.0
Author: Nevermined AG

Documentation

n8n-nodes-nevermined-payments

npm version
License: MIT

This is an n8n community node that allows you to integrate Nevermined Payments into your n8n workflows, enabling AI monetization with both crypto and fiat payment processing.

n8n is a fair-code licensed workflow automation platform.

Nevermined is an open protocol for AI monetization, supporting crypto and fiat payments.

Table of Contents

Installation

Installing in n8n

Follow the installation guide in the n8n community nodes documentation.

Method 1: Install via n8n UI

  1. Open your n8n instance
  2. Go to Settings > Community Nodes
  3. Select "Install a community node"
  4. Enter n8n-nodes-nevermined-payments
  5. Click "Install"

Method 2: Install via npm

npm install n8n-nodes-nevermined-payments

Authentication

This node requires Nevermined API credentials. To obtain your credentials:

  1. Sign up for a Nevermined account at app.nevermined.io
  2. Navigate to your dashboard
  3. Generate an API key
  4. Choose your environment (Production or Test)

Setting up credentials in n8n:

  1. In your n8n workflow, add the Nevermined Payments node
  2. Click on "Credentials" and then "Create New"
  3. Enter the following:
    • Credential Name: A descriptive name (e.g., "Nevermined Production")
    • API Key: Your NVM_API_KEY from the Nevermined dashboard
    • Environment: Select between:
      • Production: For live transactions
      • Test: For testing and development

Operations

The Nevermined Payments node supports the following operations:

1. Register Agent

Register a new AI agent with metadata and plan associations.

Parameters:

  • Agent ID: Unique identifier for the agent
  • Agent Name: Display name for the agent
  • Description: Description of the agent's capabilities
  • Service Type: Type of service (e.g., 'agent', 'service', 'dataset')
  • Access Type: Choose between 'credits' or 'time-based'
  • Amount: Number of credits or time units
  • Token Address: (Optional) Custom token address for payments
  • Associated Plan IDs: (Optional) Array of plan IDs to associate

2. Register Credits Plan

Create new payment plans with pricing and credit amounts.

Parameters:

  • Plan Name: Name of the subscription plan
  • Description: Detailed description of the plan
  • Plan Type: Choose between 'one-time', 'recurring', or 'credits'
  • Price: Cost of the plan
  • Credits: Number of credits included
  • Currency: Payment currency (e.g., 'USD', 'EUR', 'USDC')
  • Recurrence: (For recurring plans) daily, weekly, monthly, yearly
  • Agent ID: Associated agent identifier

3. Order Plan

Purchase a subscription plan for a user.

Parameters:

  • Plan ID: The ID of the plan to purchase
  • Subscriber Address: Wallet or email address of the subscriber
  • Agreed Price: The price agreed for the order
  • Duration: (Optional) Duration in days for time-based plans

4. Validate Request

Check if a request has valid access to use a service.

Parameters:

  • Agent ID: The agent to validate access for
  • Subscriber Address: Address of the requester
  • Plan ID: (Optional) Specific plan to validate against

5. Redeem Credits

Use credits from a purchased plan.

Parameters:

  • Plan ID: The plan to redeem credits from
  • Subscriber Address: Address of the credit holder
  • Credits to Redeem: Number of credits to use

Usage Examples

Example 1: Setting up an AI Agent with Credit-Based Access

{
  "operation": "registerAgent",
  "agentId": "ai-assistant-001",
  "name": "AI Writing Assistant",
  "description": "Advanced AI assistant for content creation",
  "serviceType": "agent",
  "accessType": "credits",
  "amount": 1000,
  "tokenAddress": "0x..."
}

Example 2: Creating a Monthly Subscription Plan

{
  "operation": "registerPlan",
  "name": "Pro Monthly",
  "description": "Professional tier with 10,000 credits per month",
  "planType": "recurring",
  "price": 29.99,
  "credits": 10000,
  "currency": "USD",
  "recurrence": "monthly",
  "agentId": "ai-assistant-001"
}

Example 3: Complete Workflow - Agent Registration to Credit Redemption

  1. Register Agent → 2. Create Plans → 3. User Orders Plan → 4. Validate Access → 5. Redeem Credits

Development

To contribute to this node or run it in development mode:

# Clone the repository
git clone https://github.com/nevermined-io/n8n-nodes-nevermined-payments.git
cd n8n-nodes-nevermined-payments

# Install dependencies
npm install

# Build the node
npm run build

# Run in development mode (watches for changes)
npm run dev

# Format code
npm run format

# Lint code
npm run lint

# Fix linting issues
npm run lintfix

Project Structure

n8n-nodes-nevermined-payments/
├── credentials/
│   └── NeverminedPaymentsApi.credentials.ts
├── nodes/
│   └── NeverminedPayments/
│       ├── NeverminedPayments.node.ts
│       └── nevermined.svg
├── dist/                    # Compiled JavaScript files
├── package.json
├── tsconfig.json
└── README.md

Testing

Run the test suite:

npm test

The test suite includes:

  • Unit tests for all operations
  • Credential validation tests
  • Integration tests with mock API responses

Troubleshooting

Common Issues

  1. Authentication Errors

    • Verify your API key is correct
    • Check you're using the right environment (Production vs Test)
    • Ensure your API key has the necessary permissions
  2. Operation Failures

    • Check all required parameters are provided
    • Verify subscriber addresses are in the correct format
    • Ensure credit balances are sufficient for redemption
  3. Build Errors

    • Make sure you have Node.js >=16.0.0 installed
    • Run npm install to ensure all dependencies are installed
    • Check TypeScript version compatibility

Resources

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by Nevermined AG

Discussion