yarn add btcpay-greenfield-node-client
or
npm install btcpay-greenfield-node-client
btcpay-greenfield-node-client
uses Btcpay Greenfield API keys. To create an API Key in BTCPay:
- Click on the "Account" icon on the bottom-left corner of BTCPay.
- Click "Manage Account"
- Click into the "API Keys" tab.
- Go through the "Generate Key" process.
import { OpenAPI } from 'btcpay-greenfield-node-client';
OpenAPI.BASE = 'https://your-btcpayserver-url.com';
import { OpenAPI } from 'btcpay-greenfield-node-client';
OpenAPI.TOKEN = process.env.BTCPAY_API_KEY;
// or as a function
OpenAPI.TOKEN = () => {
return 'SOME_TOKEN';
};
import { OpenAPI } from 'btcpay-greenfield-node-client';
OpenAPI.USERNAME = process.env.BTCPAY_USERNAME;
OpenAPI.PASSWORD = process.env.BTCPAY_PASSWORD;
// or as function
OpenAPI.USERNAME = () => {
return 'USERNAME';
};
OpenAPI.PASSWORD = () => {
return 'PASSWORD';
};
- Run
yarn generate
- Commit
- Run
yarn build
- Publish to
npm
This library leverages the work done by @ferdikoomen in openapi-typescript-codegen.