Skip to content

Commit

Permalink
Fix cjs usage (#382)
Browse files Browse the repository at this point in the history
* Don't use default export

* Create healthy-pots-design.md
  • Loading branch information
lukasIO authored Jan 7, 2025
1 parent 49583d2 commit 81b2d3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-pots-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-server-sdk": patch
---

Fix cjs usage of WebhookReceiver
2 changes: 1 addition & 1 deletion packages/livekit-server-sdk/src/WebhookReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { BinaryReadOptions, JsonReadOptions, JsonValue } from '@bufbuild/protobuf';
import { WebhookEvent as ProtoWebhookEvent } from '@livekit/protocol';
import { TokenVerifier } from './AccessToken.js';
import digest from './digest.js';
import { digest } from './digest.js';

export const authorizeHeader = 'Authorize';

Expand Down
2 changes: 1 addition & 1 deletion packages/livekit-server-sdk/src/digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

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

0 comments on commit 81b2d3c

Please sign in to comment.