Skip to content

Commit

Permalink
remove reliance on crypto for unsecure environments (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwebs authored May 10, 2024
1 parent 16d8433 commit 90959c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/courier-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const client = {
if(!event) {
throw new Error("event is required")
}
let indempotentKey = self.crypto.randomUUID();
let indempotentKey = (self.crypto.randomUUID) ? self.crypto.randomUUID() : Math.random().toString(36).substring(2, 15) +
Math.random().toString(36).substring(2, 15);
await this.instance.post(`/inbound/courier`, {
messageId: indempotentKey,
type:"track",
Expand All @@ -60,4 +61,4 @@ const client = {
},
};

export default client;
export default client;

0 comments on commit 90959c2

Please sign in to comment.