Skip to main content

Installation

Install the package via npm or yarn:
npm install @nevermined-io/payments

yarn add @nevermined-io/payments

Basic Setup

import { Payments } from '@nevermined-io/payments'

const payments = Payments.getInstance({
  nvmApiKey: process.env.NVM_API_KEY!,
  environment: 'sandbox' // or 'live'
})

Configuration Options

OptionTypeRequiredDescription
nvmApiKeystringYesYour Nevermined API key
environmentEnvironmentYes'sandbox' or 'live'
appIdstringNoOptional application identifier
versionstringNoOptional version string

Environment Details

EnvironmentNetworkUse Case
sandboxBase SepoliaDevelopment and testing
liveBase MainnetLive applications

TypeScript Support

The SDK includes full TypeScript type definitions:
import type {
  Payments,
  Agent,
  Plan,
  PriceConfig,
  CreditsConfig,
  ValidationResult
} from '@nevermined-io/payments'

Getting Your API Key

  1. Go to nevermined.app
  2. Sign in with Web3Auth
  3. Navigate to Settings > API Keys
  4. Generate and copy your key
export NVM_API_KEY="nvm:your-api-key-here"

Next Steps