UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

2 lines (1 loc) 847 B
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/embedded-wallets.mjs";import"../../utils/getUserEmbeddedSolanaWallet.mjs";import"../../utils/getAllUserEmbeddedSolanaWallets.mjs";import"../../utils/shouldCreateEmbeddedEthWallet.mjs";import"../../utils/shouldCreateEmbeddedSolWallet.mjs";class s{async syncWithToken(s,l,i){let d=await this._privyInternal.fetch(e,{body:{token:s,mode:i}});await this._privyInternal.session.updateWithTokensResponse(d);let r=await t(this._embedded,d,l?.embedded);return this._privyInternal.callbacks?.setUser?.(r.user),r}constructor(e,t){this._privyInternal=e,this._embedded=t}}export{s as default};