@@ -159,24 +159,28 @@ export class Seam extends Routes {
159159 }
160160 }
161161
162- static async getClientSessionToken (
163- ops : CSTParams
164- ) : Promise < APIResponse < ClientSessionResponse > > {
162+ static async getClientSessionToken ( options : {
163+ publishableKey ?: string
164+ userIdentifierKey : string
165+ endpoint ?: string
166+ workspaceId ?: string
167+ apiKey ?: string
168+ } ) : Promise < APIResponse < ClientSessionResponse > > {
165169 const { apiKey, endpoint, axiosOptions } =
166- getSeamClientOptionsWithDefaults ( ops )
170+ getSeamClientOptionsWithDefaults ( options )
167171 let headers : AxiosRequestHeaders = {
168172 ...axiosOptions ?. headers ,
169173 }
170174
171- if ( ops . publishableKey ?. startsWith ( "seam_pk" ) ) {
175+ if ( options . publishableKey ?. startsWith ( "seam_pk" ) ) {
172176 // frontend mode
173- headers [ "seam-publishable-key" ] = ops . publishableKey
177+ headers [ "seam-publishable-key" ] = options . publishableKey
174178 } else if ( apiKey ?. startsWith ( "seam_" ) ) {
175179 // backend mode
176180 headers [ "seam-api-key" ] = apiKey
177181 }
178- if ( ops . userIdentifierKey ) {
179- headers [ "seam-user-identifier-key" ] = ops . userIdentifierKey
182+ if ( options . userIdentifierKey ) {
183+ headers [ "seam-user-identifier-key" ] = options . userIdentifierKey
180184 } else {
181185 throw new Error ( "userIdentifierKey is required" )
182186 }
@@ -204,11 +208,3 @@ export class Seam extends Routes {
204208 }
205209 }
206210}
207-
208- type CSTParams = {
209- publishableKey ?: string
210- userIdentifierKey : string
211- endpoint ?: string
212- workspaceId ?: string
213- apiKey ?: string
214- }
0 commit comments