{"id":26086932,"url":"https://github.com/pspdfkit/pspdfkit-server-example-nodejs","last_synced_at":"2025-10-15T09:02:14.746Z","repository":{"id":14771319,"uuid":"67719005","full_name":"PSPDFKit/pspdfkit-server-example-nodejs","owner":"PSPDFKit","description":"Sample for PSPDFKit Server and Instant","archived":false,"fork":false,"pushed_at":"2024-03-14T18:43:47.000Z","size":190,"stargazers_count":20,"open_issues_count":0,"forks_count":14,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-04-14T13:11:07.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pspdfkit.com/instant/","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":"2016-09-08T16:07:30.000Z","updated_at":"2024-07-15T10:49:22.460Z","dependencies_parsed_at":"2023-02-17T04:45:54.311Z","dependency_job_id":"47e3ee44-e41d-400d-8519-73145e2232d0","html_url":"https://github.com/PSPDFKit/pspdfkit-server-example-nodejs","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-server-example-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-server-example-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-server-example-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2Fpspdfkit-server-example-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSPDFKit","download_url":"https://codeload.github.com/PSPDFKit/pspdfkit-server-example-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510814,"owners_count":21116282,"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":[],"created_at":"2025-03-09T07:18:58.518Z","updated_at":"2025-10-15T09:02:14.662Z","avatar_url":"https://github.com/PSPDFKit.png","language":"JavaScript","readme":"# Nutrient Document Engine Example – Node.js\n\nThis example shows how to integrate Nutrient Document Engine and\n[Nutrient Web SDK](https://www.nutrient.io/sdk/web/) into a Node.js / Express app.\n\n_Note: This example demonstrates the usage of Nutrient Web SDK in a Node.js application and is not optimized for production deployments. For information on how to set up Nutrient Web SDK in production, please refer to [our guides](https://www.nutrient.io/guides/document-engine/deployment/) instead._\n\n## Prerequisites\n\nWe recommend you use Docker to get all components up and running quickly.\n\n- [Docker](https://www.docker.com/community-edition)\n\nYou can easily run the example in trial mode without need for a license or activation key. Just make sure to check out this repository locally. The provided `docker-compose.yml` and `Dockerfile` will allow you to edit the example app on your host, and it will live-reload:\n\n```sh\n$ git clone https://github.com/PSPDFKit/pspdfkit-server-example-nodejs.git\n$ cd pspdfkit-server-example-nodejs\n$ docker compose up\n```\n\nThe example is now running on [http://localhost:3000](http://localhost:3000). You can access the Nutrient Document Engine dashboard at [http://localhost:5000/dashboard](http://localhost:5000/dashboard) using `dashboard` // `secret`.\n\nUpload a PDF via the button in the top-left, then click on the cover image to see Nutrient Web SDK in action.\n\n## AI Assistant\n\nThis example also includes the [Nutrient AI Assistant](https://www.nutrient.io/sdk/ai-assistant), a powerful tool that enables you to extract information from documents using natural language queries. To activate the AI Assistant, you will need a valid OpenAI API key with sufficient credits. Follow these steps to get started:\n\n1. Open a terminal and set the `OPENAI_API_KEY` environment variable with your OpenAI API key:\n\n   ```sh\n   $ OPENAI_API_KEY=YOUR_OPENAI_API_KEY_GOES_HERE docker compose up\n   ```\n\n2. Replace `YOUR_OPENAI_API_KEY_GOES_HERE` with your actual OpenAI API key.\n\nOnce the environment is running, you can add documents to the AI Assistant by clicking the \"Add to AI Assistant\" button. For more details about Nutrient AI Assistant and its capabilities, visit [our guide](https://www.nutrient.io/guides/ai-assistant/).\n\n## Using a license\n\nIf you have a Nutrient Document Engine license you can use it as well by going through the following steps:\n\n1.  Open the [`docker-compose.yml`](docker-compose.yml) file in an editor of your choice and replace the `YOUR_LICENSE_KEY_GOES_HERE` placeholder with your standalone license key.\n\n2.  Start environment with your Nutrient Document Engine activation key:\n\n```sh\n$ ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker compose up\n```\n\nIf you are using Windows make sure to set the environment variables accordingly. For this replace the line starting with `ACTIVATION_KEY=\"...` with:\n\n```shell\n$ SET \"ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE\"\n$ docker compose up\n```\n\nMake sure to replace `YOUR_ACTIVATION_KEY_GOES_HERE` with your Nutrient Document Engine activation key. You only have to provide the activation key once, after that Document Engine will remain activated until you reset it.\n\nAnd if you have an AI Assistant license, you can pass it in a similar way, by setting the `AIA_ACTIVATION_KEY` environment variable.\n\n### Resetting the server\n\nYou can reset the server by first tearing down its containers and volumes and then recreating them.\n\n```sh\n$ docker compose down --volumes\n$ docker compose up\n```\n\nIf using an activation key, you'd need to set it again so as to recreate the containers:\n\n```sh\n$ docker compose down --volumes\n$ ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker compose up\n```\n\nIf you are using Windows make sure to set the environment variables accordingly. For this replace the line starting with `ACTIVATION_KEY=\"...` with:\n\n```shell\n$ SET \"ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE\"\n$ docker compose up\n```\n\n## Running the example locally\n\nYou can also run the example app directly on your machine, outside of a Docker container.\n\n### Prerequisites\n\n- [Node.js](http://nodejs.org/)\n- [Nutrient Document Engine](https://www.nutrient.io/getting-started/document-engine/)\n  running on [http://localhost:5000](http://localhost:5000) with the default configuration\n\n### Getting Started\n\n```sh\n$ git clone https://github.com/PSPDFKit/pspdfkit-server-example-nodejs.git\n$ cd pspdfkit-server-example-nodejs\n$ npm install\n$ npm start\n```\n\nThe example app is now running on \u003chttp://localhost:3000\u003e.\n\nUpload a PDF via the button in the top-left, then click on the cover image to see Nutrient Web SDK\nin action.\n\nYou can quit the running containers with Ctrl-C.\n\nIf you want to test Nutrient Web SDK on different devices in your local network, you need\nto edit the `DOCUMENT_ENGINE_EXTERNAL_URL` environment variable in the `docker-compose.yml` and set it to an address that's reachable from your device.\n\n## Troubleshooting\n\nOccasionally running the `docker compose` scripts will result in errors because some containers are in a broken state. To resolve this, you can reset all containers and their attached volumes by running the following command:\n\n```sh\ndocker compose down --volumes\n```\n\nIf you have further troubles, you can always reach out to us via our [support platform](https://support.nutrient.io/hc/requests/new).\n\n## Support, Issues and License Questions\n\nNutrient offers support for customers with an active SDK license via https://support.nutrient.io/hc/requests/new\n\nAre you [evaluating our SDK](https://www.nutrient.io/sdk/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/contact-sales?=sdk\n\n## License\n\nThis software is licensed under a [modified BSD license](LICENSE).\n\n## Contributing\n\nPlease ensure\n[you signed our CLA](https://www.nutrient.io/guides/web/miscellaneous/contributing/) so we can\naccept your contributions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fpspdfkit-server-example-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpspdfkit%2Fpspdfkit-server-example-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fpspdfkit-server-example-nodejs/lists"}