Parameters

  1. tokenOrCallback: string | TokenCallback
    The valid Xkit Token or a token callback function.
  2. tokenCallback: TokenCallback?
    A token callback function.

Returns

Promise<void>

Creates a session with Xkit and updates the internal configuration of xkit.js to allow for refreshing of access tokens for Xkit.

await xkit.login(some_context_token)
await xkit.login(async () => {
  const response = await fetch('/auth/token')
  const json = await response.json()
  return json['token']
})