You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package contains the Hono-based API server that powers the Publisher Tools. It runs on Cloudflare Workers and is responsible for fetching tool configurations, handling Open Payments, and managing probabilistic revenue sharing.
4
+
5
+
## Endpoints
6
+
7
+
The API exposes endpoints related to the following functionalities:
8
+
9
+
-**Tool Configuration:** Handles fetching the configuration for the monetization tools (see `src/routes/get-config.ts`).
10
+
-**Payments:** Manages the Open Payments flow (see `src/routes/payment.ts`).
11
+
-**Probabilistic Revshare:** Handles logic related to probabilistic revenue sharing (see `src/routes/probabilistic-revshare.ts`).
12
+
13
+
## Development
14
+
15
+
To run the API server for local development, you can use the `dev` script from the project root:
16
+
17
+
```sh
18
+
pnpm -C api dev
19
+
```
20
+
21
+
This will start the Cloudflare Wrangler development server, which automatically reloads on file changes.
This package is responsible for building and delivering the final, browser-ready JavaScript assets (the banner and widget scripts) that publishers embed on their websites.
4
+
5
+
It takes the raw source code from the `@tools/components` package, bundles it using `esbuild`, and prepares it for delivery via the Cloudflare CDN.
6
+
7
+
## Build Process
8
+
9
+
The core of this package is the custom build script located at `build.js`. This script uses `esbuild` to compile the TypeScript source from `src/` and the components from the `components` package into distributable files.
10
+
11
+
The main entry points for the build are:
12
+
13
+
-`src/banner.ts`
14
+
-`src/widget.ts`
15
+
16
+
The output is placed in the `dist/` directory.
17
+
18
+
## Assets
19
+
20
+
This package also manages static assets required by the components, such as fonts. The build process ensures that these assets are correctly referenced and made available through the CDN. Fonts are located in the `src/assets/fonts` directory.
21
+
22
+
## Development
23
+
24
+
To build the assets and run a local development server that simulates the CDN, use the `dev` script from the project root. This will watch for file changes in both the `cdn` and `components` packages and automatically rebuild.
This package contains the core, embeddable web components for the Publisher Tools, built using the [Lit](https://lit.dev/) library. These components are intended to be placed on publishers' websites.
4
+
5
+
## Core Components
6
+
7
+
-**Banner:** A notification banner that can be displayed on a publisher's site. The source is located in `src/banner.ts`.
8
+
-**Widget:** The interactive monetization widget. Its source code is in the `src/widget/` directory.
9
+
10
+
## Build Process
11
+
12
+
This package contains the raw source code for the web components but does not have its own build process.
13
+
14
+
The components are imported and bundled by the **`cdn`** package, which is responsible for compiling them into a browser-ready format. They are also used by the **`frontend`** package for demonstration purposes.
15
+
16
+
Please see the `cdn` package for more details on the build and delivery process.
17
+
18
+
## Development
19
+
20
+
The only available script is for type checking, which can be run from the project root:
This is the public address of your wallet where you can receive payments.
70
80
71
-
1. In your Interledger testnet wallet dashboard
72
-
2. Find your wallet address
73
-
3. Copy the payment pointer and convert it to `https://` format.
81
+
1. In your Interledger wallet dashboard, find your payment pointer. It will look something like `$ilp.interledger-test.dev/my-wallet`.
82
+
2. To get the wallet address, simply replace the `$` with `https://`.
74
83
75
-
### AWS Configuration
76
-
77
-
These variables configure S3 storage for configuration data:
84
+
For example, if your payment pointer is `$ilp.interledger-test.dev/alice`, your `OP_WALLET_ADDRESS` would be `https://ilp.interledger-test.dev/alice`.
78
85
79
-
#### `AWS_ACCESS_KEY_ID`
86
+
###AWS Configuration
80
87
81
-
AWS access key for S3 operations\
82
-
**Development Note**: This key is ignored when using the local S3 simulator, so it's not required for development
88
+
These variables are for connecting to an S3 bucket, which is used to store the configuration for the publisher tools. For local development, a simulated S3 service is used, so you don't need real AWS credentials.
This package contains the Remix frontend application for the Publisher Tools, providing a user-friendly dashboard for publishers to configure and manage monetization on their websites.
4
+
5
+
## Core Features
6
+
7
+
The dashboard allows users to customize and generate code for the following tools:
8
+
9
+
-**Index (`/`):** The main landing page that offers an overview of the available monetization tools.
10
+
-**Banner (`/banner`):** A tool to create a customizable notification banner that can be displayed on a publisher's website, often used to inform users about monetization or request consent.
11
+
-**Widget (`/widget`):** A configuration page for the monetization widget, which provides users with a clear and interactive way to make payments or donations.
12
+
-**Link Tag (`/link-tag`):** A simple tool for generating a monetized `<link>` tag, which can be embedded in a website to enable Web Monetization.
13
+
-**Probabilistic Revshare (`/prob-revshare`):** A UI for setting up probabilistic revenue sharing, allowing publishers to distribute incoming payments among multiple recipients based on assigned weights.
14
+
-**Payment Confirmation (`/payment-confirmation`):** A dedicated page to display the status of a payment to the user. Embedded tools may redirect users to this page after a payment is completed or fails.
15
+
16
+
The application also includes API routes (e.g., `api.config.$type.ts`) that are handled by the Remix server to manage configuration and other backend tasks.
17
+
18
+
## Development
19
+
20
+
To run the frontend application for local development, use the `dev` script from the project root:
0 commit comments