Skip to content

Commit

Permalink
fix(fix deps and clientkey): fix client key and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
rileylnapier committed May 14, 2024
1 parent a6809f7 commit ce6fc4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
]
},
"dependencies": {
"@trycourier/courier-js": "^1.4.2",
"pkg-dir": "^7.0.0"
}
}
1 change: 1 addition & 0 deletions packages/react-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"license": "ISC",
"dependencies": {
"@trycourier/courier-js": "^1.4.2",
"@trycourier/client-graphql": "^6.0.0",
"buffer": "^6.0.3",
"jwt-decode": "^3.1.2",
Expand Down
9 changes: 8 additions & 1 deletion packages/react-provider/src/hooks/use-courier-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ const useCourierActions = (state, dispatch): ICourierContext => {
userSignature: state.userSignature,
});

let clientKey = state.clientKey;

//ensure we always have a clientkey
if (!clientKey && state.authorization) {
clientKey = "JWT_AUTH";
}

courier.init({
baseUrl: state.apiUrl,
authorization: state.authorization,
clientKey: state.clientKey,
clientKey,
userId: state.userId,
userSignature: state.userSignature,
});
Expand Down

0 comments on commit ce6fc4c

Please sign in to comment.