@privy-io/js-sdk-core
Version:
Vanilla JS client for the Privy Auth API
2 lines (1 loc) • 797 B
JavaScript
import{CustomJWTAuthenticate as e}from"@privy-io/public-api";import{maybeCreateWalletOnLogin as t}from"./maybeCreateWalletOnLogin.mjs";import"../../utils/getUserEmbeddedEthereumWallet.mjs";import"../../utils/getAllUserEmbeddedEthereumWallets.mjs";import"../../utils/getUserEmbeddedSolanaWallet.mjs";import"../../utils/getAllUserEmbeddedSolanaWallets.mjs";import"../../utils/shouldCreateEmbeddedEthWallet.mjs";import"../../utils/shouldCreateEmbeddedSolWallet.mjs";class s{async syncWithToken(s,l){let i=await this._privyInternal.fetch(e,{body:{token:s}});await this._privyInternal.session.updateWithTokensResponse(i);let r=await t(this._embedded,i,l?.embedded);return this._privyInternal.callbacks?.setUser?.(r.user),r}constructor(e,t){this._privyInternal=e,this._embedded=t}}export{s as default};