Skip to content
Alchemy Logo

cookieToInitialState

function cookieToInitialState(config, cookie?): undefined | StoredState;

Defined in: account-kit/core/src/utils/cookies.ts:77

Converts a cookie into an initial state object

ParameterTypeDescription

config

AlchemyAccountsConfig

the account config containing the client store

cookie?

string

optional cookie string

undefined | StoredState

the deserialized AlchemyClientState if the cookie exists, otherwise undefined

Was this page helpful?