PageSeal
Watermark eBooks and PDFs for each buyer
@pageseal/medusa
eBook, PDF and audiobook watermarking (social DRM) for Medusa v2. Sell eBooks, PDFs and audiobooks in your Medusa store and give every buyer a personal copy: their name and order number on a page of the book plus an invisible mark that leads back to the order if the file turns up online. Pageseal checks each file on Apple Books, Kindle, Kobo/Android and Readium before you sell it, hosts the download page with download limits, and finds the order behind a leaked copy.
Same service as the Pageseal Shopify app (https://pageseal.app), connected through an API key.
What the plugin does
When What happens Payment captured (Copy to clipboardpayment.captured, or Copy to clipboardorder.placed with auto-capture) Pageseal creates one personal copy per eBook line, mails the buyer the download link (optional) and returns the links; the plugin stores them in Copy to clipboardorder.metadata.pageseal Order canceled / fully refunded The download links of the order stop Customer deleted Pageseal removes the buyer's name and email (the mark still leads to the order) Product page in the admin Widget: upload an EPUB, PDF or audiobook, see the device check, link the book, put it live Order page in the admin Widget: personal copies with download link, downloads used, block/unblock, send the mail again Admin menu Pageseal Plan and usage, all books with their check, leak search (paste text or drop a found file) Plan card on the Pageseal page Choose a plan (Stripe Checkout), switch plans, manage cancellation, payment method and invoices (Stripe customer portal) Storefront Copy to clipboardGET /store/pageseal/orders/:id returns the download links for the order confirmation page and the customer account
Installation
- Create an account at https://pageseal.app/signup and add a Medusa store: it shows the API key and the webhook secret once. As long as sign-up is closed there, write to support@pageseal.app.
- Install the plugin:
1npm install @pageseal/medusa
- Add it to Copy to clipboard
medusa-config.ts:
1234567891011121314151617module.exports = defineConfig({// …plugins: [{resolve: "@pageseal/medusa",options: {apiKey: process.env.PAGESEAL_API_KEY, // psk_…webhookSecret: process.env.PAGESEAL_WEBHOOK_SECRET, // whsec_…// apiUrl: "https://pageseal.app", // default// deliverOn: "captured", // or "placed" (deliver before the capture)// sendMail: null, // null = Pageseal setting, false = your own mail sends the links// guestAccessHours: 72, // guests see their links on the confirmation page this long// redactOnCustomerDelete: true,},},],})
- Restart Medusa. Open a product, upload the book in the Pageseal widget, wait for the check, click Put live.
The plugin needs no database migration and no extra module. Every option can also come from the environment (Copy to clipboardPAGESEAL_API_URL, Copy to clipboardPAGESEAL_API_KEY, Copy to clipboardPAGESEAL_WEBHOOK_SECRET, Copy to clipboardPAGESEAL_DELIVER_ON, Copy to clipboardPAGESEAL_SEND_MAIL, Copy to clipboardPAGESEAL_GUEST_ACCESS_HOURS, Copy to clipboardPAGESEAL_REDACT_ON_CUSTOMER_DELETE).
Plans and billing
Plans, prices and limits are the same as in the Shopify app (Free, Starter, Pro, Scale). Billing runs through Stripe: pick a plan on the Pageseal page in the admin, pay in Stripe Checkout and you are back in Medusa. Copies above the included amount are billed per copy with the monthly invoice. Switching plans happens on the plan card (prorated); cancellation, payment method and invoices are in the Stripe customer portal behind Manage billing. Stores in test mode are never billed.
Download links in the storefront
The Next.js starter example in Copy to clipboardstorefront/PagesealDownloads.tsx shows the links on the order confirmation page (Copy to clipboardsrc/modules/order/templates/order-completed-template.tsx) and in the customer account (Copy to clipboardsrc/modules/account/components/order-details). Customers with an account see the links of their own orders only; guests see them on the confirmation page for Copy to clipboardguestAccessHours, afterwards in the delivery mail.
Your own order confirmation mail can read the links from Copy to clipboardorder.metadata.pageseal.copies[] (Copy to clipboardtitle, Copy to clipboardurl). Payment is captured after the mail? Set Copy to clipboardsendMail to Copy to clipboardnull (Pageseal mails the links when they exist).
Security
- The API key goes only from your Medusa server to Pageseal, never to the browser. Pageseal stores only its hash.
- Order events (delivery, revoke, GDPR) are signed with HMAC-SHA256 (Copy to clipboard
X-Pageseal-Signature: t=<unix>,v1=<hex>over Copy to clipboard"<t>.<raw body>", at most 5 minutes old). A leaked API key alone cannot create or block copies. - Each store's data lives in its own database at Pageseal; the store is taken from the key, never from the request.
Development
1234npm installnpm test # unit tests of the client (node --test)npm run build # medusa plugin:buildnpx medusa plugin:develop # with yalc in a local store
Changelog
- 0.1.1 – The default Copy to clipboard
apiUrlis now Copy to clipboardhttps://pageseal.app(0.1.0 pointed to a host that does not exist, so the plugin worked only with Copy to clipboardapiUrlset). - 0.1.0 – First release.
Licence
MIT. The Pageseal service is billed separately through Stripe (see Plans and billing).
