Skip to content

Commit 4163f6f

Browse files
authoredMar 14, 2025··
fix: allow siteID and token to be passed in Functions v2 and Edge Fun… (#217)
1 parent 322ff9e commit 4163f6f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎src/store_factory.ts

+13
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ export const getStore: {
6868
return new Store({ client, name: input })
6969
}
7070

71+
if (typeof input?.name === 'string' && typeof input?.siteID === 'string' && typeof input?.token === 'string') {
72+
const { name, siteID, token } = input
73+
const clientOptions = getClientOptions(input, { siteID, token })
74+
75+
if (!name || !siteID || !token) {
76+
throw new MissingBlobsEnvironmentError(['name', 'siteID', 'token'])
77+
}
78+
79+
const client = new Client(clientOptions)
80+
81+
return new Store({ client, name })
82+
}
83+
7184
if (typeof input?.name === 'string') {
7285
const { name } = input
7386
const clientOptions = getClientOptions(input)

0 commit comments

Comments
 (0)
Please sign in to comment.