Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aryanj-nyc/btcpay-greenfield-node-client
https://github.com/aryanj-nyc/btcpay-greenfield-node-client
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/aryanj-nyc/btcpay-greenfield-node-client
- Owner: AryanJ-NYC
- License: mit
- Created: 2021-02-09T05:07:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-12T15:31:28.000Z (about 2 years ago)
- Last Synced: 2024-11-02T04:15:55.943Z (5 days ago)
- Language: TypeScript
- Size: 182 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BTCPay Greenfield Node Client
## Installation
```bash
yarn add btcpay-greenfield-node-client
```or
```bash
npm install btcpay-greenfield-node-client
```## Configuration
`btcpay-greenfield-node-client` uses Btcpay Greenfield API keys. To create an API Key in BTCPay:
1. Click on the "Account" icon on the bottom-left corner of BTCPay.
2. Click "Manage Account"
3. Click into the "API Keys" tab.
4. Go through the "Generate Key" process.### Set Base URL
```typescript
import { OpenAPI } from 'btcpay-greenfield-node-client';OpenAPI.BASE = 'https://your-btcpayserver-url.com';
```### Authorization
#### API Key
```typescript
import { OpenAPI } from 'btcpay-greenfield-node-client';OpenAPI.TOKEN = process.env.BTCPAY_API_KEY;
// or as a function
OpenAPI.TOKEN = () => {
return 'SOME_TOKEN';
};
```#### Username & Password
```typescript
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';
};
```## Usage
## Development
1. Run `yarn generate`
2. Commit
3. Run `yarn build`
4. Publish to `npm`## Acknowledgement
This library leverages the work done by [@ferdikoomen](https://github.com/ferdikoomen) in [openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen).