Example application showing how to use Money Button for pay walls, webhooks, and OAuth.
You can see our public demo of this app at markdownpaywall.com.
To run a demo of Markdown Paywall, you will need to run an instance with a public-facing OAuth Redirect URL and a public-facing Webhoook URL.
For instance, on our public demo, we have these URLs:
| URL | Description |
|---|---|
| https://markdownpaywall.com/oauth-callback | OAuth Redirect URL |
| https://api.markdownpaywall.com/webhook | Webhook URL |
Next, create an app for testing. You will need to set the OAuth Redirect URL and the Webhook URL in your app settings.
Then you will want to create two .env files:
First, copy api/.env.example to api/.env and set the WEBHOOK_SECRET variable to be the same as your app.
Second, copy web/.env.example to web/.env and set OAUTH_IDENTIFIER to be the same as your app. Also, set OAUTH_IDENTIFIER to be the same as your app. Finally, set OAUTH_REDIRECT_URI to be the same as your app.
Now you can install Markdown Paywall and run it with these commands:
yarn
yarn dev
api: Express.js app which implements the test's backend including payment webhook handling.web: Next.js app which implements the test's frontend including a paywall.