js icon indicating copy to clipboard operation
js copied to clipboard

[thirdweb]: port phone auth to v5

Open ElasticBottle opened this issue 10 months ago • 4 comments

Problem solved

Adds phone authentication to embedded wallet in thirdweb

Changes made

  • [ ] Public API changes:
import { createThirdwebClient } from "thirdweb";
import { preAuthenticate, connectEmbeddedWallet } from "thirdweb/wallets/embedded";

// phone number with country code, no spaces
const phoneNumber = "+11234567890";
const client = createThirdwebClient({ clientId: "Your client ID" });
await preAuthenticate({
  strategy: "phone",
  phoneNumber,
  client,
});

const [wallet, chain] = await connectEmbeddedWallet({
    strategy: "phone";
    phoneNumber,
    verificationCode: "SMS_CODE_HERE"
});
  • [ ] Internal API changes: Adds internall handler to send and verify phone sms otp

How to test

  • [ ] Automated tests: None
  • [ ] Manual tests: release pr and test on local branch

PR-Codex overview

This PR adds phone authentication support to embedded wallets.

Detailed summary

  • Added phone authentication method for embedded wallets
  • Updated authentication types to include phone number
  • Implemented sending and verifying SMS login OTP
  • Updated user authentication functions to support phone numbers

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

ElasticBottle avatar Apr 04 '24 03:04 ElasticBottle

🦋 Changeset detected

Latest commit: 437fcc6bb9a7b97d7865448ec9de8ff009b78d08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
thirdweb Minor
@thirdweb-dev/react Patch
@thirdweb-dev/sdk Patch
@thirdweb-dev/cli Patch
@thirdweb-dev/react-core Patch
@thirdweb-dev/react-native Patch
@thirdweb-dev/unity-js-bridge Patch
@thirdweb-dev/wallets Patch
@thirdweb-dev/auth Patch
@thirdweb-dev/react-native-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Apr 04 '24 03:04 changeset-bot[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 76.98%. Comparing base (3be61dd) to head (437fcc6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2679   +/-   ##
=======================================
  Coverage   76.97%   76.98%           
=======================================
  Files         560      560           
  Lines       32368    32368           
  Branches     2832     2831    -1     
=======================================
+ Hits        24916    24917    +1     
  Misses       6787     6787           
+ Partials      665      664    -1     
Flag Coverage Δ
legacy_packages 65.66% <ø> (+<0.01%) :arrow_up:
packages 82.76% <ø> (ø)

see 1 file with indirect coverage changes

codecov[bot] avatar Apr 04 '24 03:04 codecov[bot]

CodSpeed Performance Report

Merging #2679 will not alter performance

Comparing winston/port-phone-auth-to-v5 (437fcc6) with main (3be61dd)

Summary

✅ 9 untouched benchmarks

codspeed-hq[bot] avatar Apr 04 '24 03:04 codspeed-hq[bot]

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 38.54 KB (0%) 771 ms (0%) 127 ms (+39.91% 🔺) 898 ms
thirdweb (cjs) 85.95 KB (0%) 1.8 s (0%) 349 ms (+113.88% 🔺) 2.1 s
thirdweb (minimal + tree-shaking) 4.7 KB (0%) 95 ms (0%) 106 ms (+2087.52% 🔺) 200 ms
thirdweb/chains (tree-shaking) 387 B (0%) 10 ms (0%) 31 ms (+873.57% 🔺) 41 ms
thirdweb/react (minimal + tree-shaking) 9.95 KB (0%) 199 ms (0%) 30 ms (+276.28% 🔺) 229 ms

github-actions[bot] avatar Apr 05 '24 11:04 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 23 '24 10:04 stale[bot]

/release-pr

MananTank avatar Apr 23 '24 15:04 MananTank

/release-pr

MananTank avatar Apr 23 '24 18:04 MananTank

/release-pr

MananTank avatar Apr 23 '24 22:04 MananTank