UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

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