Skip to content

Commit 06ea2dd

Browse files
authoredMar 27, 2025··
Add optional api key parameter to smithery url (#144)
1 parent 9913850 commit 06ea2dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function createSmitheryUrl(baseUrl: string, config?: object) {
1+
export function createSmitheryUrl(baseUrl: string, config?: object, apiKey?: string) {
22
const url = new URL(baseUrl)
33
if (config) {
44
const param =
@@ -7,5 +7,8 @@ export function createSmitheryUrl(baseUrl: string, config?: object) {
77
: Buffer.from(JSON.stringify(config)).toString("base64")
88
url.searchParams.set("config", param)
99
}
10+
if (apiKey) {
11+
url.searchParams.set("api_key", apiKey)
12+
}
1013
return url
1114
}

0 commit comments

Comments
 (0)
Please sign in to comment.