@@ -2,12 +2,12 @@ import Seam from 'seamapi'
22import { getCookie , setCookie } from '../utils'
33
44export const useSeamClient = ( {
5- publishedKey ,
5+ publishableKey ,
66 endpoint,
77 userIdentifierKey,
88 clientSessionToken,
99} : {
10- publishedKey ?: string
10+ publishableKey ?: string
1111 endpoint : string
1212 userIdentifierKey : string
1313 clientSessionToken ?: string
@@ -31,10 +31,14 @@ export const useSeamClient = ({
3131 // no need to use public key
3232 // TODO: check if client access token is valid (not expired), if expired/invalid, get new one with the public key
3333 return getSeam ( clientSessionTokenFromCookie )
34- } else if ( publishedKey ?. startsWith ( 'seam_pk1' ) ) {
34+ } else if ( publishableKey ?. startsWith ( 'seam_pk1' ) ) {
3535 // public key, need to create a client access token and store it in cookie
3636 ; ( async ( ) => {
37- const clientSessionTokenResponse = await Seam . getClientSessionToken ( { publishedKey, userIdentifierKey, endpoint } )
37+ const clientSessionTokenResponse = await Seam . getClientSessionToken ( {
38+ publishableKey,
39+ userIdentifierKey,
40+ endpoint,
41+ } )
3842 if ( clientSessionTokenResponse . ok === false || ! clientSessionTokenResponse [ 'client_session' ] ) {
3943 throw new Error ( 'Could not get client access token' )
4044 }
@@ -47,7 +51,7 @@ export const useSeamClient = ({
4751 // TODO: improve: use devices are not loading probably due to async nature of this hook
4852 } ) ( )
4953 } else {
50- throw new Error ( 'No publishedKey nor clientSessionToken provided or they are invalid' )
54+ throw new Error ( 'No publishableKey nor clientSessionToken provided or they are invalid' )
5155 return null as any
5256 }
5357 return null as any
0 commit comments