Skip to content

Commit 81b2d3c

Browse files
authored
Fix cjs usage (#382)
* Don't use default export * Create healthy-pots-design.md
1 parent 49583d2 commit 81b2d3c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/healthy-pots-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-server-sdk": patch
3+
---
4+
5+
Fix cjs usage of WebhookReceiver

packages/livekit-server-sdk/src/WebhookReceiver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { BinaryReadOptions, JsonReadOptions, JsonValue } from '@bufbuild/protobuf';
55
import { WebhookEvent as ProtoWebhookEvent } from '@livekit/protocol';
66
import { TokenVerifier } from './AccessToken.js';
7-
import digest from './digest.js';
7+
import { digest } from './digest.js';
88

99
export const authorizeHeader = 'Authorize';
1010

packages/livekit-server-sdk/src/digest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
// Use the Web Crypto API if available, otherwise fallback to Node.js crypto
6-
export default async function digest(data: string): Promise<ArrayBuffer> {
6+
export async function digest(data: string): Promise<ArrayBuffer> {
77
if (globalThis.crypto?.subtle) {
88
const encoder = new TextEncoder();
99
return crypto.subtle.digest('SHA-256', encoder.encode(data));

0 commit comments

Comments
 (0)