Example SvelteKit web app demonstrating how to use the @e4a/pg-js SDK for the Informatierijk notificeren use case.
A single-page app with two delivery modes:
- Encrypt & Send: encrypts files for a citizen (exact email) and an organisation (email domain), uploads to Cryptify, and sends an email notification to the recipients.
- Encrypt & Upload: same encryption and upload, but returns a UUID so you can distribute the download link yourself.
- Node.js 18+
- A PostGuard API key
-
Install dependencies:
cd pg-sveltekit npm install -
Configure environment variables:
cp .env.example .env
Available variables (see
.env.example):Variable Description Default PUBLIC_PKG_URLPostGuard PKG server URL https://pkg.staging.postguard.euPUBLIC_CRYPTIFY_URLCryptify file-sharing URL https://storage.staging.postguard.euPUBLIC_DOWNLOAD_URLPostGuard website used in /downloadURLshttps://staging.postguard.euon staging Cryptify, elsehttps://postguard.euPUBLIC_APP_NAMEApp display name PostGuard for Business Example
npm run devOpen http://localhost:5173 in your browser.
The default PUBLIC_CRYPTIFY_URL is storage.staging.postguard.eu — the staging
deployment. It does not actually deliver notification emails, so you can exercise
the full upload + notify flow without spamming real inboxes while you integrate the SDK.
What this means for the example:
- The upload itself works. You get back a real UUID and the download URL is usable.
- The Encrypt & Send flow succeeds, but no email is sent to the recipient. The UI will surface a banner and show the download URL — open it yourself to verify the decrypt flow end-to-end.
- Point
PUBLIC_CRYPTIFY_URLat the production Cryptify host to exercise real email delivery.
npm run build
npm run preview # preview the production build