File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @snapauth/sdk" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.2 " ,
4
4
"description" : " SnapAuth JS/TS SDK" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change
1
+ // This constant is set by webpack during the build process
2
+ declare var VERSION : string
3
+
1
4
import {
2
5
base64URLToArrayBuffer ,
3
6
arrayBufferToBase64URL ,
@@ -154,6 +157,7 @@ class SDK {
154
157
Accept : 'application/json' ,
155
158
'Content-type' : 'application/json' ,
156
159
Authorization : `Basic ${ btoa ( this . apiKey + ':' ) } ` ,
160
+ 'X-SDK' : `js/${ VERSION } ` ,
157
161
} )
158
162
159
163
const request = new Request ( this . host + path , {
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' )
2
+ const webpack = require ( 'webpack' )
2
3
3
4
module . exports = {
4
5
entry : './src/index.ts' ,
@@ -10,6 +11,11 @@ module.exports = {
10
11
library : 'SnapAuth' ,
11
12
libraryTarget : 'umd' ,
12
13
} ,
14
+ plugins : [
15
+ new webpack . DefinePlugin ( {
16
+ VERSION : JSON . stringify ( require ( './package.json' ) . version ) ,
17
+ } ) ,
18
+ ] ,
13
19
module : {
14
20
rules : [
15
21
{
You can’t perform that action at this time.
0 commit comments