Skip to content

Commit 335ee90

Browse files
Update GatsbyJS example.
1 parent 708d095 commit 335ee90

File tree

6 files changed

+41
-49
lines changed

6 files changed

+41
-49
lines changed

examples/gatsbyjs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ yarn-debug.log*
1717
yarn-error.log*
1818

1919
static/pspdfkit-lib
20+
static/nutrient-viewer-lib

examples/gatsbyjs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Nutrient Web SDK Example – Gatsby.js
22

3-
This example shows how to integrate [Nutrient Web SDK](https://www.nutrient.io/web/) into a GatsbyJS project.
3+
This example shows how to integrate [Nutrient Web SDK](https://www.nutrient.io/sdk/web/) into a GatsbyJS project.
44

55
## Prerequisites
66

77
- [Node.js](http://nodejs.org/)
88

99
## Support, Issues and License Questions
1010

11-
PSPDFKit offers support for customers with an active SDK license via https://www.nutrient.io/support/request/
11+
Nutrient offers support for customers with an active SDK license via https://www.nutrient.io/support/request/
1212

1313
Are 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/
1414

@@ -17,8 +17,8 @@ Are you [evaluating our SDK](https://www.nutrient.io/try/)? That's great, we're
1717
Clone the repo:
1818

1919
```bash
20-
git clone https://github.com/PSPDFKit/pspdfkit-web-example-gatsbyjs.git
21-
cd pspdfkit-web-example-gatsbyjs
20+
git clone https://github.com/PSPDFKit/nutrient-web-examples.git
21+
cd nutrient-web-examples/examples/gatsbyjs
2222
```
2323

2424
Install the project dependencies:
@@ -46,14 +46,14 @@ nom run serve
4646

4747
Enjoy 🍕
4848

49-
## PSPDFKit assets
49+
## Nutrient Web SDK assets
5050

51-
In order to make the example work, the PSPDFKit assets need to be copied from their original location in `./node_modules/pspdfkit/dist` to `./static`. This is done automatically from a postinstall script in located in `./scripts/copy-pspdfkit-files.js`.
51+
In order to make the example work, the Nutrient assets need to be copied from their original location in `./node_modules/@nutrient-sdk/viewer/dist` to `./static`. This is done automatically from a postinstall script in located in `./scripts/copy-nutrient-files.js`.
5252

5353
In case copying the files fails, you can copy them manually:
5454

55-
- Copy `./node_modules/pspdfkit/dist/pspdfkit.js` to `./static/pspdfkit.js`.
56-
- Copy `./node_modules/pspdfkit/dist/pspdfkit-lib/` to `./static/pspdfkit-lib/`.
55+
- Copy `./node_modules/@nutrient-sdk/viewer/dist/nutrient-viewer.js` to `./static/nutrient-viewer.js`.
56+
- Copy `./node_modules/@nutrient-sdk/viewer/dist/nutrient-viewer-lib/` to `./static/nutrient-viewer-lib/`.
5757

5858
That's it!
5959

examples/gatsbyjs/package-lock.json

Lines changed: 24 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/gatsbyjs/package.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pspdfkit-web-example-gatsbyjs",
33
"private": true,
4-
"description": "Basic integration of PSPDFKit in GatsbyJS",
4+
"description": "Basic integration of Nutrient Web SDK in GatsbyJS",
55
"version": "1.0.0",
66
"license": "SEE LICENSE IN https://www.nutrient.io/legal/Nutrient_SDK_User_Evaluation_Subscription_Agreement",
77
"engines": {
@@ -14,27 +14,20 @@
1414
"start": "npm run develop",
1515
"serve": "gatsby serve",
1616
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \"",
17-
"postinstall": "node scripts/copy-pspdfkit-files",
17+
"postinstall": "node scripts/copy-nutrient-files",
1818
"start:e2e": "npm run start"
1919
},
2020
"dependencies": {
21+
"@nutrient-sdk/viewer": "1.0.0",
2122
"gatsby": "^5.13.7",
2223
"gatsby-source-filesystem": "^5.13.1",
23-
"pspdfkit": "2024.8.1",
2424
"react": "^18.0.0",
2525
"react-dom": "^18.0.0"
2626
},
2727
"devDependencies": {
2828
"ncp": "^2.0.0",
2929
"prettier": "^3.3.2"
3030
},
31-
"repository": {
32-
"type": "git",
33-
"url": "https://github.com/PSPDFKit/pspdfkit-web-example-gatsbyjs"
34-
},
35-
"bugs": {
36-
"url": "https://github.com/PSPDFKit/pspdfkit-web-example-gatsbyjs/issues"
37-
},
3831
"overrides": {
3932
4033
"react": "^18.2.0"
@@ -45,6 +38,7 @@
4538
"send": "^0.19.0",
4639
"axios": "^1.7.4",
4740
"cookie": "^0.7.0",
48-
"cross-spawn": "^7.0.5"
41+
"cross-spawn": "^7.0.5",
42+
"serialize-javascript": "^6.0.2"
4943
}
5044
}

examples/gatsbyjs/scripts/copy-pspdfkit-files.js renamed to examples/gatsbyjs/scripts/copy-nutrient-files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const ncp = require("ncp").ncp;
22
const fs = require("node:fs");
33

44
ncp(
5-
"./node_modules/pspdfkit/dist/pspdfkit-lib",
6-
"./static/pspdfkit-lib",
5+
"./node_modules/@nutrient-sdk/viewer/dist/nutrient-viewer-lib",
6+
"./static/nutrient-viewer-lib",
77
(err) => {
88
err && console.error(err);
99
},

examples/gatsbyjs/src/templates/Viewport.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Viewport = (props) => {
2525
// Gatsby needs client-side only packages need to be imported asynchronously
2626
// https://www.gatsbyjs.com/docs/using-client-side-only-packages/
2727
pspdfkitScript.src =
28-
"https://cdn.cloud.www.nutrient.io/pspdfkit-web@2024.8.0/pspdfkit.js";
28+
"https://cdn.cloud.pspdfkit.com/pspdfkit-web@1.0.0/nutrient-viewer.js";
2929
document.head.appendChild(pspdfkitScript);
3030

3131
return () => {

0 commit comments

Comments
 (0)