0.19.1 • Published 9 days ago

@privy-io/js-sdk-core v0.19.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 days ago

@privy-io/js-sdk-core

🔧 The Privy JS SDK is a low-level library and not intended for general consumption.

Before building, please reach out to the Privy team to discuss your project and which Privy SDK options may be better suited to it.

Usage

Auth

const privy = new Privy({appId: '<your-app-id-here>'});

await privy.auth.sms.sendCode('+1 555 555 5555');
const {user} = await privy.auth.sms.loginWithCode('+1 555 555 5555', '123123');

Embedded Wallets

// Or use the embedded wallet with viem
import {createWalletClient, custom} from 'viem';

// Initialize the client
const privy = new Privy({appId: '<your-app-id-here>'});

// Log in
await privy.auth.sms.sendCode('+1 555 555 5555');
const {user} = await privy.auth.sms.loginWithCode('+1 555 555 5555', '123123');

// Create an embedded wallet
const wallet = await privy.embeddedWallet.create();

// Use the embedded wallet
const accounts = await wallet.request({method: 'eth_requestAccounts'});
const response = await wallet.request({
  method: 'eth_sendTransaction',
  params: [
    {
      from: accounts[0],
      to: '0x0000000000000000000000000000000000000000',
      value: '1',
    },
  ],
});

// create a viem client from the privy embedded wallet
const viemWalletClient = createWalletClient({
  chain: mainnet,
  transport: custom(wallet),
});

// use viem to sign a message
await viemWalletClient.signMessage({
  message: 'Hello from Privy!!',
  account: wallet.address,
});
0.19.1

9 days ago

0.19.0

13 days ago

0.18.2

19 days ago

0.18.1

23 days ago

0.18.0

25 days ago

0.17.1

26 days ago

0.17.0

1 month ago

0.16.0

1 month ago

0.16.1

1 month ago

0.15.3

1 month ago

0.15.1

1 month ago

0.15.2

1 month ago

0.15.0

2 months ago

0.14.0

2 months ago

0.13.7

2 months ago

0.13.6

2 months ago

0.13.5

2 months ago

0.13.4

2 months ago

0.13.3

2 months ago

0.13.2

3 months ago

0.13.1

3 months ago

0.13.0

3 months ago

0.12.2

3 months ago

0.12.1

3 months ago

0.12.0

3 months ago

0.11.4

3 months ago

0.11.5

3 months ago

0.11.3

3 months ago

0.11.2

4 months ago

0.11.0

4 months ago

0.11.1

4 months ago

0.9.4

4 months ago

0.10.0

4 months ago

0.9.3

4 months ago

0.9.2

4 months ago

0.9.1

4 months ago

0.9.0

4 months ago

0.8.6

5 months ago

0.8.5

5 months ago

0.8.4

5 months ago

0.8.3

5 months ago

0.8.2

5 months ago

0.8.1

5 months ago

0.8.0

6 months ago

0.7.1

6 months ago

0.7.0

6 months ago

0.6.1

7 months ago

0.6.0

7 months ago

0.5.1

7 months ago

0.5.0

7 months ago

0.4.0

7 months ago

0.3.0

8 months ago

0.2.0

8 months ago

0.1.1

8 months ago

0.0.1

8 months ago

0.0.0

8 months ago