Skip to content

Commit 34cd65a

Browse files
committed
update webhook client setup
1 parent 4cfb0cd commit 34cd65a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/wrapper/WebhooksClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Webhooks } from "../api/resources/webhooks/client/Client";
2+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../core/headers.js";
23
import crypto from "crypto";
34

45
// Extends the namespace declared in the Fern generated client
@@ -16,7 +17,7 @@ declare module "../api/resources/webhooks/client/Client" {
1617
}
1718

1819
export class Client extends Webhooks {
19-
constructor(protected readonly _options: Webhooks.Options) {
20+
constructor(_options: Webhooks.Options) {
2021
super(_options);
2122
}
2223

@@ -47,7 +48,6 @@ export class Client extends Webhooks {
4748
const encoder = new TextEncoder();
4849

4950
// Encode the signingSecret key
50-
// @ts-expect-error TS2339: Property 'subtle' does not exist on type 'typeof import("crypto")'.
5151
const key = await crypto.subtle.importKey(
5252
"raw",
5353
encoder.encode(signingSecret),
@@ -57,7 +57,6 @@ export class Client extends Webhooks {
5757
);
5858

5959
// Encode the message and compute HMAC signature
60-
// @ts-expect-error TS2339: Property 'subtle' does not exist on type 'typeof import("crypto")'.
6160
const signature = await crypto.subtle.sign("HMAC", key, encoder.encode(message));
6261

6362
// Convert signature to hex string

0 commit comments

Comments
 (0)