Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CDDelta/ngx-monetization
Web Monetization API for Angular!
https://github.com/CDDelta/ngx-monetization
angular typescript web-monetization
Last synced: 3 months ago
JSON representation
Web Monetization API for Angular!
- Host: GitHub
- URL: https://github.com/CDDelta/ngx-monetization
- Owner: CDDelta
- License: mit
- Archived: true
- Created: 2020-05-15T08:42:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T10:39:55.000Z (over 2 years ago)
- Last Synced: 2024-06-04T16:55:48.368Z (5 months ago)
- Topics: angular, typescript, web-monetization
- Language: TypeScript
- Homepage: https://cddelta.github.io/ngx-monetization/
- Size: 855 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-web-monetization - ngx-monetization (archived) - Web Monetization API for Angular. ![](assets/small_icons/angular.png) (Resources / Packages)
README
# ngx-monetization
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/cddelta/ngx-monetization/issues)
[![https://nodei.co/npm/ngx-monetization.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/ngx-monetization.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/ngx-monetization)
Web Monetization API for Angular!
`ngx-monetization` helps you interact with the Web Monetization API with an observable-based API.
The Web Monetization API is
**a JavaScript browser API which allows the creation of a payment stream from the user agent to the website**, read more about it [here](https://webmonetization.org/).Check out the demo [here](https://cddelta.github.io/ngx-monetization/).
## Install
To use `ngx-monetization` in your project run:
```bash
ng add ngx-monetization
```or install it via npm:
```bash
npm install ngx-monetization --save
```and add your payment pointer to `index.html`, see [here](https://webmonetization.org/docs/getting-started).
## Example Use
```typescript
import { Component } from "@angular/core";
import { MonetizationService } from "ngx-monetization";@Component({
selector: "app-root",
template: `
State: {{ monetization.state | async }}
-
{{ event | json }}
`,
})
export class AppComponent {
constructor(public monetization: MonetizationService) {
monetization.setPaymentPointer("$wallet.example.com/alice");
}
}
```
## Contributing
To contribute to this library, clone it locally and run `npm install`.
To build the library run:
```bash
npm run build
```
To run tests run:
```bash
npm run test
```
To test the demo app run:
```bash
npm run start
```