File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/components/ImageKitComponent Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 4747 "webpack-dev-server" : " ^3.9.0"
4848 },
4949 "dependencies" : {
50- "imagekit-javascript" : " ^1.0.1 " ,
50+ "imagekit-javascript" : " ^1.0.3 " ,
5151 "prop-types" : " ^15.7.2" ,
5252 "react-scripts" : " ^3.3.0"
5353 }
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { PureComponent } from 'react';
22import PropTypes from 'prop-types' ;
33import ImageKit from 'imagekit-javascript' ;
44import { ImageKitContextType } from '../IKContext/ImageKitContextType' ;
5+ const pjson = require ( '../../../package.json' ) ;
6+
57class ImageKitComponent extends PureComponent {
68 constructor ( props , context ) {
79 super ( props , context ) ;
@@ -52,12 +54,14 @@ class ImageKitComponent extends PureComponent {
5254
5355 if ( src ) {
5456 let ik = new ImageKit ( {
57+ sdkVersion : `react-${ pjson . version } ` ,
5558 publicKey : publicKey ,
5659 urlEndpoint : urlEndpoint ,
5760 } ) ;
5861 return ik . url ( { src : src , transformation : transformation , transformationPosition : "query" } ) ;
5962 } else if ( path ) {
6063 let ik = new ImageKit ( {
64+ sdkVersion : `react-${ pjson . version } ` ,
6165 publicKey : publicKey ,
6266 urlEndpoint : urlEndpoint
6367 } ) ;
@@ -106,6 +110,7 @@ class ImageKitComponent extends PureComponent {
106110 }
107111
108112 let ik = new ImageKit ( {
113+ sdkVersion : `react-${ pjson . version } ` ,
109114 publicKey : publicKey ,
110115 urlEndpoint : urlEndpoint ,
111116 authenticationEndpoint : authenticationEndpoint
You can’t perform that action at this time.
0 commit comments