Skip to content

Commit 562675a

Browse files
committed
feat: added exception for browser client side openai client
1 parent 6fa726a commit 562675a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nillion/nilai-ts",
3-
"version": "0.0.0-alpha.2",
3+
"version": "0.0.0-alpha.3",
44
"description": "Nilai Typescript SDK",
55
"type": "module",
66
"main": "dist/index.js",

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export class NilaiOpenAIClient extends OpenAI {
6161
break;
6262
case AuthType.DELEGATION_TOKEN:
6363
processedOptions.apiKey = "<placeholder>";
64+
// Because no real API key is needed, we can allow the browser to use it
65+
processedOptions.dangerouslyAllowBrowser = true;
6466
break;
6567
default:
6668
throw new Error(`Invalid auth type: ${authType}`);

0 commit comments

Comments
 (0)