{"id":26086879,"url":"https://github.com/pspdfkit/pspdfkit-web-example-pwa","last_synced_at":"2025-04-12T03:23:17.398Z","repository":{"id":70605210,"uuid":"142283746","full_name":"PSPDFKit/pspdfkit-web-example-pwa","owner":"PSPDFKit","description":"Create a progressive web app (PWA) with PSPDFKit for Web","archived":false,"fork":false,"pushed_at":"2025-03-10T10:34:04.000Z","size":213,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-25T22:51:30.569Z","etag":null,"topics":["javascript","pdf","pspdfkit","pwa","web","web-application","webassembly"],"latest_commit_sha":null,"homepage":"https://pspdfkit.com/blog/2018/pwa-progressive-web-applications/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PSPDFKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-25T10:16:54.000Z","updated_at":"2025-03-10T10:34:07.000Z","dependencies_parsed_at":"2023-03-09T14:45:36.067Z","dependency_job_id":"253ee979-dd72-4d63-a6ce-1baf6fd9f142","html_url":"https://github.com/PSPDFKit/pspdfkit-web-example-pwa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-web-example-pwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-web-example-pwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-web-example-pwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-web-example-pwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSPDFKit","download_url":"https://codeload.github.com/PSPDFKit/pspdfkit-web-example-pwa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510798,"owners_count":21116277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","pdf","pspdfkit","pwa","web","web-application","webassembly"],"created_at":"2025-03-09T07:18:45.296Z","updated_at":"2025-04-12T03:23:17.387Z","avatar_url":"https://github.com/PSPDFKit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ⚠️ **Repository Moved**  \n\u003e This repository has been moved to https://github.com/PSPDFKit/nutrient-web-examples/tree/main/examples/pwa.  \n\u003e Please update your bookmarks and issues accordingly.\n\u003e\n\u003e This repo is now archived and will no longer receive updates.\n\n# Nutrient Web SDK Example - PWA\n\nThis example shows how to integrate [Nutrient Web SDK](https://www.nutrient.io/sdk/web/) and create a PWA (Progressive Web App).\n\nYou can check out a live preview here: [www.nutrient.io/pwa](https://www.nutrient.io/pwa/).\n\nThis sample application features a basic PWA setup including a [manifest](src/manifest.js) and a [service worker](src/serviceWorker.js), to allow your app to function offline as well as an [IndexedDB storage](src/scripts/PSPDFKitFileStorage.js) for PDFs. This way, your files are persisted even after you close the browser.\n\nIn this example we use [workbox](https://github.com/GoogleChrome/workbox), a popular PWA framework by Google.\n\n## Prerequisites\n\n- [Node.js](http://nodejs.org/)\n\n## Support, Issues and License Questions\n\nPSPDFKit offers support for customers with an active SDK license via https://www.nutrient.io/support/request/\n\nAre you [evaluating our SDK](https://www.nutrient.io/try/)? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://www.nutrient.io/sales/\n\n## Getting Started\n\nClone the repo:\n\n```bash\ngit clone https://github.com/PSPDFKit/pspdfkit-web-example-pwa.git\ncd pspdfkit-web-example-pwa\n```\n\nInstall the project dependencies with `npm`:\n\n```bash\nnpm install\n```\n\n## Running the Example\n\nWe are ready to launch the app! 🎉\n\nTo run the app in development mode:\n\n```bash\nnpm run start\n```\n\n## Build Production Artifacts\n\nTo build a production version, just follow the above guide but instead of running `start`:\n\n```bash\nnpm run build\n```\n\nThe build script will then create a file called `./dist` which you can copy to your webserver as-is.\n\n## How it works\n\nUnder `./src` you can find a simple application shell that loads Nutrient Web SDK.\n\nThe application uses a [service worker](src/serviceWorker.js) to provide offline support and pre-caching for the majority of the assets.\n\nTo reduce the amount of boilerplate, we use [workbox](https://github.com/GoogleChrome/workbox) - a library from Google that abstracts away some of the verbosity associated to the service worker creation and configuration.\n\nWe also use workbox-cli, another library from Google, to automatically generate a Manifest file for our ServiceWorker pre-cache when we run `npm start`. You can find this configuration file in [`./src/workbox-config.js`](src/workbox-config.js).\n\nTo allow PDFs to be persisted locally so they do not need to be downloaded again, we've created the [`NutrientFileStore`](src/scripts/NutrientFileStore.js) library. It uses a lightweight and `Promise`-based wrapper around the IndexedDB API called [`idb`](https://github.com/jakearchibald/idb) under the hood. The code is designed to work independently of the PWA example and can also be used in Internet Explorer 11.\n\n## Mobile Support\n\nIf you try to connect to the local development server remotely you'll quickly see that the PWA is not working as expected. This is due to the fact that the PWA APIs [require a valid SSL/TLS certificate](https://developers.google.com/web/progressive-web-apps/checklist) to properly function and you will probably not have this setup locally.\n\nFor a better experience, we suggest you check out the [hosted PWA example](https://www.nutrient.io/pwa/) or deploy a production build to your own server.\n\n## License\n\nThis software is licensed under a [modified BSD license](LICENSE).\n\n## Contributing\n\nPlease ensure [you have signed our CLA](https://www.nutrient.io/guides/web/current/miscellaneous/contributing/) so that we can accept your contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fpspdfkit-web-example-pwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpspdfkit%2Fpspdfkit-web-example-pwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fpspdfkit-web-example-pwa/lists"}