Getting Started
Select which library flavour to use
Depending on where you want to integrate the library and the application you want to build, you can choose between the Python or Typescript library:
- Python: Github repository nevermined-io/payments-py and PyPi package
- Typescript: Github repository nevermined-io/payments and NPM package
Both Payments libraries implementations are Open Source (Apache v2).
Requirements
Get a Nevermined API Key
To use the Payments libraries you need to create a Nevermined API Key. This key will allow you to interact with the Nevermined platform and create Payment Plans and Agents.
The Nevermined API Key must be created in the environment where you will run your application. For example, if you are running a Python application connected to the "testing", you need to create the API Key in the Nevermined Testing App but if you want to use the Live environment you must use the Nevermined App.
You need to keep your API Key secure and never share it with anyone.
Install the library
- Python
- Typescript
pip install payments-py
npm install @nevermined-io/payments
Initialize the Payments instance
- Python
- Typescript
- Typescript (Browser)
# @see https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys
nvm_api_key = 'eyJhbGciOiJFUzI1NksifQ.ey .....'
# If you want to connect to production use 'arbitrum' as environment
payments = Payments(nvm_api_key, environment=Environment.get_environment('testing')) # 'local' | 'staging' | 'testing' | 'arbitrum' | 'peaq' | 'custom'
// To get your own Nevermined API Key, follow the instructions here:
// https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys
const nvmApiKey = 'eyJhbGciOiJFUzI1NksifQ.ey .....'
// If you want to connect to production use 'arbitrum' as environment
const payments = Payments.getInstance({
nvmApiKey,
environment: 'testing', // 'local' | 'staging' | 'testing' | 'arbitrum' | 'peaq' | 'custom'
})
// If you want to connect to production use 'arbitrum' as environment
const payments = Payments.getBrowserInstance({
returnUrl: 'https://mysite.example.com',
environment: 'testing'
})
payments.connect()