Skip to content

Commit 9953f60

Browse files
authored
Merge pull request #2 from imagekit-developer/improvements
chore: pass sdkVersion to url request
2 parents d2cb319 + 350644d commit 9953f60

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"babel-plugin-require-context-hook": "^1.0.0",
2525
"core-js": "^3.4.3",
26-
"imagekit-javascript": "^1.0.1",
26+
"imagekit-javascript": "^1.0.3",
2727
"jest-vue-preprocessor": "^1.7.0",
2828
"vue": "^2.6.11"
2929
},

src/helpers/upload.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import ImageKit from 'imagekit-javascript';
2+
const pjson = require('../../package.json');
23

34
export const uploadImage = ({ e, file, fileName, useUniqueFileName, tags, folder, isPrivateFile, customCoordinates, responseFields, publicKey, urlEndpoint, authenticationEndpoint }) => {
45

6+
57
if (!publicKey) {
68
throw new Error("Missing publicKey during initialization");
79
}
@@ -29,6 +31,7 @@ export const uploadImage = ({ e, file, fileName, useUniqueFileName, tags, folder
2931
};
3032

3133
const ik = new ImageKit({
34+
sdkVersion : `vuejs-${pjson.version}`,
3235
publicKey: publicKey,
3336
urlEndpoint: urlEndpoint,
3437
authenticationEndpoint: authenticationEndpoint

src/helpers/urlGenerators.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ImageKit from 'imagekit-javascript';
2+
const pjson = require('../../package.json');
23

34
export const generateUrl = ({publicKey, urlEndpoint, src, path, transformation}) => {
45

@@ -11,6 +12,7 @@ export const generateUrl = ({publicKey, urlEndpoint, src, path, transformation})
1112
}
1213

1314
const ik = new ImageKit({
15+
sdkVersion : `vuejs-${pjson.version}`,
1416
publicKey: publicKey,
1517
urlEndpoint: urlEndpoint,
1618
});

0 commit comments

Comments
 (0)