Skip to content

Commit 1a6a7f3

Browse files
committed
chore: pass sdkVersion to url request
1 parent d2cb319 commit 1a6a7f3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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)