diff --git a/embedded-wallets/sdk/node/README.mdx b/embedded-wallets/sdk/node/README.mdx new file mode 100644 index 00000000000..5f414cae743 --- /dev/null +++ b/embedded-wallets/sdk/node/README.mdx @@ -0,0 +1,282 @@ +--- +title: Embedded Wallets SDK for Node.js +sidebar_label: Getting Started +description: 'MetaMask Embedded Wallets SDK for Node.js | Backend Documentation' +--- + +import TabItem from '@theme/TabItem' +import Tabs from '@theme/Tabs' +import SdkTroubleshootingIntro from '../_common/_sdk-troubleshooting-intro.mdx' + +## Overview + +The MetaMask Embedded Wallets Node.js SDK is a backend solution designed for server-side authentication and key management. This SDK enables seamless integration of Web3 authentication into backend applications, AI agents, and programmatic use cases. + +Unlike frontend SDKs, the Node.js SDK is **stateless and sessionless**, making it ideal for: + +- Backend AI agents +- Server-side wallet operations +- Programmatic blockchain interactions +- Custodial wallet services, without key management and recovery worries. + +## Key Features + +- **Stateless Architecture**: No session management required +- **Multi-Chain Support**: EVM chains, Solana, and other blockchains +- **Custom Authentication**: Mandatory custom auth with single key share +- **Private Key Access**: Direct access to private keys for any blockchain +- **Backend-Optimized**: Designed specifically for server environments + +## Requirements + +- Node.js 18+ +- Custom authentication setup (mandatory) +- Web3Auth Dashboard project configuration + +## Installation + +Install the Web3Auth Node SDK + +```bash npm2yarn +npm install --save @web3auth/node-sdk +``` + +## Setup + +:::info Prerequisites + +Before you start, make sure you have: + +1. Registered on the [**Web3Auth Dashboard**](https://dashboard.web3auth.io/) +2. Set up a project with a custom **Auth Connection** (mandatory for Node.js SDK) + +::: + +### 1. Custom Authentication Setup (Required) + +The Node.js SDK **only supports custom authentication**. You must create a custom auth connection in the Web3Auth Dashboard: + +1. Go to [Web3Auth Dashboard](https://dashboard.web3auth.io/) +2. Select your project +3. Navigate to **Authentication** → **Custom Connections** +4. Click **Create connections** +5. Configure your auth connection with your custom JWT details + +:::info + +You can refer to the [Custom JWT Setup](/embedded-wallets/authentication/custom-connections/custom-jwt/) guide to learn more. + +::: + +### 2. SDK Configuration + +Create a Web3Auth instance with your client ID, web3auth network name, and chain information: + +```javascript +const web3auth = new Web3Auth({ + clientId: 'YOUR_CLIENT_ID', // Get your Client ID from Web3Auth Dashboard + web3AuthNetwork: 'sapphire_mainnet', // or 'sapphire_devnet' +}) +``` + +> The chain information is optional and will be used to setup the provider for connecting to the chain. If not provided, the first chain in the list will be used. + +### 3. Initialize Web3Auth + +Initialize the Web3Auth instance during your application startup: + +```javascript +await web3auth.init() +``` + +### 4. Authenticate Users + +Use the connect method with your custom authentication parameters: + +```javascript +const result = await web3auth.connect({ + authConnectionId: 'YOUR_AUTH_CONNECTION_ID', // Your custom authentication connection name + idToken: 'USER_ID_TOKEN', // JWT token from your auth system +}) +``` + +## Configuration Options + + + + + +```javascript +const { Web3Auth } = require('@web3auth/node-sdk') + +const web3auth = new Web3Auth({ + clientId: 'YOUR_CLIENT_ID', + web3AuthNetwork: 'sapphire_mainnet', // or 'sapphire_devnet' +}) + +await web3auth.init() +``` + + + + + +```javascript +const { Web3Auth } = require('@web3auth/node-sdk') + +const web3auth = new Web3Auth({ + clientId: 'YOUR_CLIENT_ID', + web3AuthNetwork: 'sapphire_mainnet', // or 'sapphire_devnet' + defaultChainId: '0x1', // or '0x89' for Polygon + enableLogging: true, + sessionTime: 3600, +}) + +await web3auth.init() +``` + + + + + +## Configuration Parameters + + + + + +| Parameter | Type | Default | Description | +| ----------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | `string` | Required | Your Web3Auth client ID | +| `web3AuthNetwork` | `string` | Required | Network: 'sapphire_mainnet' or 'sapphire_devnet' | +| `defaultChainId` | `string` | Optional | Chain ID to use for the default chain (e.g., '0x1' for Ethereum). If not provided, the first chain in the list will be used. | +| `chains` | `object` | Optional | Chains to use for the authentication. It takes `Chains` as a value. | +| `enableLogging` | `boolean` | Optional | Setting to true will enable logs. Default is false. | +| `usePnPKey` | `boolean` | Optional | Setting to true will use the PnP key. Default is false. | +| `useDKG` | `boolean` | Optional | Setting to true will use the DKG. Default is false. | +| `checkCommitment` | `boolean` | Optional | Setting to true will check the commitment. Default is true. | + + + + + +```javascript +export interface Web3AuthOptions { + /** + * Client id for web3auth. + * You can obtain your client id from the web3auth developer dashboard. + * You can set any random string for this on localhost. + */ + clientId: string; + + /** + * Web3Auth Network to use for login + * @defaultValue mainnet + */ + web3AuthNetwork?: WEB3AUTH_NETWORK_TYPE; + + /** + * multiple chain configurations, + * only provided chains will be used + */ + chains?: CustomChainConfig[]; + + /** + * default chain Id to use + */ + defaultChainId?: string; + + /** + * setting to true will enable logs + * + * @defaultValue false + */ + enableLogging?: boolean; + + /** + * setting this to true returns the same key as web sdk (i.e., plug n play key) + * By default, this sdk returns SFAKey + */ + usePnPKey?: boolean; + + /** + * set this to true when you wants keys/shares to be generated by a dkg network + * + * Default:- false for sapphire network and always true for legacy networks. + * Legacy networks doesnt support non dkg flow. So this is always true for legacy networks. + */ + useDKG?: boolean; + + /** + * setting this to true will check the commitment of the shares + * + * @defaultValue true + */ + checkCommitment?: boolean; +} +``` + + + + + +## Usage + +```javascript +// focus-start +const { Web3Auth } = require('@web3auth/node-sdk') +// focus-end + +// Dashboard Registration +const clientId = + 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ' + +// Auth Connection +const authConnectionId = 'w3a-node-demo' + +// focus-start +const web3auth = new Web3Auth({ + clientId, + web3AuthNetwork: 'sapphire_mainnet', +}) + +await web3auth.init() +// focus-end + +const privateKey = await fs.readFile('privateKey.pem', 'utf8') + +var idToken = jwt.sign( + { + sub: '9fcd68c4-af50-4dd7-adf6-abd12a13cb32', + name: 'Web3Auth DevRel Team', + email: 'devrel@web3auth.io', + aud: 'urn:api-web3auth-io', // -> to be used in Custom Authentication as JWT Field + iss: 'https://web3auth.io', // -> to be used in Custom Authentication as JWT Field + iat: Math.floor(Date.now() / 1000), + exp: Math.floor(Date.now() / 1000) + 60 * 60, + }, + privateKey, + { algorithm: 'RS256', keyid: '2ma4enu1kdvw5bo9xsfpi3gcjzrt6q78yl0h' } +) + +console.log('\x1b[33m%s\x1b[0m', 'JWT Token:', idToken) + +// focus-start +const result = await web3auth.connect({ + authConnectionId, + idToken, +}) +// focus-end +``` diff --git a/embedded-wallets/sdk/node/blockchain-connection.mdx b/embedded-wallets/sdk/node/blockchain-connection.mdx new file mode 100644 index 00000000000..d023052224f --- /dev/null +++ b/embedded-wallets/sdk/node/blockchain-connection.mdx @@ -0,0 +1,139 @@ +--- +title: Blockchain Connection +description: 'Integrate with Blockchain Networks' +--- + +Web3Auth Node SDK supports multiple blockchain networks through different integration methods. On a successful connection, it returns a `result` object containing the provider/ signer for blockchain operations. + +By default you get the standard Web3Auth provider, with the ability to get the private key, if enabled from the dashboard. You additionally get the signer for EVM and Solana chains, to be able to do transactions without the need to use the private key provider directly. + +### Object Structure + +```typescript +import type { TransactionSigner } from '@solana/signers' +import type { Wallet } from 'ethers' +import type { CHAIN_NAMESPACES, IBaseProvider } from '@web3auth/no-modal' +export type PrivateKeyProvider = IBaseProvider + +export type WalletResult = + | { + chainNamespace: typeof CHAIN_NAMESPACES.SOLANA + provider: PrivateKeyProvider + signer: TransactionSigner + } + | { + chainNamespace: typeof CHAIN_NAMESPACES.EIP155 + provider: PrivateKeyProvider + signer: Wallet + } + | { + chainNamespace: typeof CHAIN_NAMESPACES.OTHER + provider: PrivateKeyProvider + signer: null + } +``` + +### EVM Chains (Ethereum, Polygon, BSC, etc.) + +Use the provider with ethers.js or convert to viem: + +```javascript +// focus-next-line +const { ethers } = require('ethers') + +// Get Ethereum Accounts +const getAccounts = async signer => { + try { + // focus-next-line + const address = await signer.getAddress() + console.log('\x1b[33m%s\x1b[0m', 'Accounts:', address) + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error fetching accounts:', error) + } +} + +// Get Ethereum Balance +const getBalance = async signer => { + try { + // focus-start + const address = await signer.getAddress() + const balance = ethers.formatEther( + await signer.provider.getBalance(address) // Balance is in wei + ) + // focus-end + console.log('\x1b[33m%s\x1b[0m', 'Balance:', balance, 'ETH') + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error fetching balance:', error) + } +} + +// Sign Ethereum Message +const signMessage = async (signer, message) => { + try { + // focus-next-line + const signature = await signer.signMessage(message) + console.log('\x1b[33m%s\x1b[0m', 'Signed Message:', signature) + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error signing message:', error) + } +} + +await getAccounts(result.signer) // Get Ethereum Accounts +await getBalance(result.signer) // Get Ethereum Balance +await signMessage(result.signer, 'Hello Web3Auth!') // Sign a Message +``` + +### Solana Integration + +Access Solana wallet functionality: + +```javascript +const { LAMPORTS_PER_SOL, Connection, PublicKey } = require('@solana/web3.js') +const { createSignableMessage } = require('@solana/signers') + +// Get Solana Accounts +const getAccounts = async signer => { + try { + // focus-next-line + const publicKey = signer.address + console.log('\x1b[33m%s\x1b[0m', 'Public Key:', publicKey) + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error fetching accounts:', error) + } +} + +// Get Solana Balance +const getBalance = async signer => { + try { + // focus-start + const publicKey = new PublicKey(signer.address) + const connection = new Connection('https://api.devnet.solana.com') + const balance = (await connection.getBalance(publicKey)) / LAMPORTS_PER_SOL + // focus-end + console.log('\x1b[33m%s\x1b[0m', 'Balance:', balance, 'SOL') + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error fetching balance:', error) + } +} + +// Sign Solana Message +const signMessage = async (signer, message) => { + try { + // focus-start + const messageBytes = new TextEncoder().encode(message) + + // Create a SignableMessage object from Uint8Array + const signableMessage = createSignableMessage(messageBytes) + + const [signature] = await signer.signMessages([signableMessage]) + // focus-end + console.log('\x1b[33m%s\x1b[0m', 'Signed Message:', signature) + } catch (error) { + console.error('\x1b[33m%s\x1b[0m', 'Error signing message:', error) + } +} + +await getAccounts(result.signer) // Get Solana Accounts +await getBalance(result.signer) // Get Solana Balance +await signMessage(result.signer, 'Hello Web3Auth!') // Sign a Message +``` diff --git a/embedded-wallets/sdk/node/connect.mdx b/embedded-wallets/sdk/node/connect.mdx new file mode 100644 index 00000000000..14cc5bd926f --- /dev/null +++ b/embedded-wallets/sdk/node/connect.mdx @@ -0,0 +1,171 @@ +--- +title: Connect +description: 'Authenticate users and establish provider connection' +--- + +## Overview + +The `connect` method is the primary authentication method for the Node.js SDK. It authenticates users using custom authentication and returns a result object containing the provider/ signer for blockchain operations. + +:::warning Prerequisites + +- You need to have a custom authentication setup on the dashboard. +- You need to have a freshly generated JWT token from your authentication system in your backend. + +Read more about [Custom Authentication](/embedded-wallets/authentication/custom-connections/custom-jwt/). + +::: + +## Usage + +```javascript +const result = await web3auth.connect(loginParams) +``` + +## Parameters + +### LoginParams + +```typescript +export type LoginParams = { + idToken: string + authConnectionId: string + userId?: string + userIdField?: string + isUserIdCaseSensitive?: boolean + groupedAuthConnectionId?: string +} +``` + +| Parameter | Type | Description | +| -------------------------- | --------- | ----------------------------------------------------------------------------------------- | +| `authConnectionId` | `string` | Custom verifier name from Web3Auth Dashboard | +| `userId` | `string` | Unique identifier for the user (email, user ID, etc.) | +| `idToken?` | `string` | Valid JWT token from your authentication system | +| `groupedAuthConnectionId?` | `string` | Grouped auth connection ID | +| `userIdField?` | `string` | User's unique identifier field name. Add here if not set on the dashboard. | +| `isUserIdCaseSensitive?` | `boolean` | Whether the user id field is case sensitive or not. Add here if not set on the dashboard. | + +## Return Value + +Returns a `result` object containing the provider/ signer for blockchain operations. By default you get the standard Web3Auth provider, with the ability to get the private key, if enabled from the dashboard. You additionally get the signer for EVM and Solana chains, to be able to do transactions without the need to use the private key provider directly. + +### Object Structure + +```typescript +import type { TransactionSigner } from '@solana/signers' +import type { Wallet } from 'ethers' +import type { CHAIN_NAMESPACES, IBaseProvider } from '@web3auth/no-modal' +export type PrivateKeyProvider = IBaseProvider + +export type WalletResult = + | { + chainNamespace: typeof CHAIN_NAMESPACES.SOLANA + provider: PrivateKeyProvider + signer: TransactionSigner + } + | { + chainNamespace: typeof CHAIN_NAMESPACES.EIP155 + provider: PrivateKeyProvider + signer: Wallet + } + | { + chainNamespace: typeof CHAIN_NAMESPACES.OTHER + provider: PrivateKeyProvider + signer: null + } +``` + +## Examples + +### Custom JWT Token Authentication + +```javascript +const { Web3Auth } = require('@web3auth/node-sdk') + +// Dashboard Registration +const clientId = + 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ' + +// focus-start +// Auth Connection +const authConnectionId = 'w3a-node-demo' +// focus-end + +const web3auth = new Web3Auth({ + clientId, + web3AuthNetwork: 'sapphire_mainnet', +}) + +await web3auth.init() + +// focus-start +const privateKey = await fs.readFile('privateKey.pem', 'utf8') + +var idToken = jwt.sign( + { + sub: '9fcd68c4-af50-4dd7-adf6-abd12a13cb32', + name: 'Web3Auth DevRel Team', + email: 'devrel@web3auth.io', + aud: 'urn:api-web3auth-io', // -> to be used in Custom Authentication as JWT Field + iss: 'https://web3auth.io', // -> to be used in Custom Authentication as JWT Field + iat: Math.floor(Date.now() / 1000), + exp: Math.floor(Date.now() / 1000) + 60 * 60, + }, + privateKey, + { algorithm: 'RS256', keyid: '2ma4enu1kdvw5bo9xsfpi3gcjzrt6q78yl0h' } +) + +console.log('\x1b[33m%s\x1b[0m', 'JWT Token:', idToken) + +const result = await web3auth.connect({ + authConnectionId, + idToken, +}) +// focus-end +``` + +### Firebase Authentication + +```javascript +const { Web3Auth } = require('@web3auth/node-sdk') + +// Dashboard Registration +const clientId = + 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ' + +// focus-start +// Auth Connection +const authConnectionId = 'w3a-firebase-demo' +// focus-end + +const web3auth = new Web3Auth({ + clientId, + web3AuthNetwork: 'sapphire_mainnet', +}) + +await web3auth.init() + +// focus-start +const app = initializeApp({ + apiKey: 'AIzaSyB0nd9YsPLu-tpdCrsXn8wgsWVAiYEpQ_E', + authDomain: 'web3auth-oauth-logins.firebaseapp.com', + projectId: 'web3auth-oauth-logins', + storageBucket: 'web3auth-oauth-logins.appspot.com', + messagingSenderId: '461819774167', + appId: '1:461819774167:web:e74addfb6cc88f3b5b9c92', +}) + +const auth = getAuth(app) +const res = await signInWithEmailAndPassword(auth, 'custom+jwt@firebase.login', 'Testing@123') +console.log(res) +const idToken = await res.user.getIdToken(true) + +console.log('\x1b[33m%s\x1b[0m', 'JWT Token:', idToken) + +const result = await web3auth.connect({ + authConnectionId, + idToken, +}) +// focus-end +``` diff --git a/embedded-wallets/sdk/node/examples.mdx b/embedded-wallets/sdk/node/examples.mdx new file mode 100644 index 00000000000..a3aabe2b105 --- /dev/null +++ b/embedded-wallets/sdk/node/examples.mdx @@ -0,0 +1,11 @@ +--- +title: Examples +sidebar_label: Examples +description: 'Node Examples | Embedded Wallets' +hide_table_of_contents: true +--- + +import ExampleCards from '@theme/ExampleCards' +import { pnpNodeExamples } from '@site/src/utils/example-maps' + + diff --git a/embedded-wallets/sdk/node/private-key.mdx b/embedded-wallets/sdk/node/private-key.mdx new file mode 100644 index 00000000000..d31db7fa050 --- /dev/null +++ b/embedded-wallets/sdk/node/private-key.mdx @@ -0,0 +1,192 @@ +--- +title: Private Key Access +description: 'Extract private keys for blockchain operations' +--- + +## Overview + +The Node.js SDK provides direct access to user private keys, enabling integration with any blockchain network. This is a key feature that makes the SDK suitable for backend and programmatic use cases. Note that if the private key export is disabled in the dashboard, the methods will throw an error. + +:::warning Security Notice + +Private keys provide full control over user assets. Handle them securely: + +- Never log private keys +- Store them encrypted if persistence is needed +- Use secure memory handling +- Implement proper access controls + +::: + +## Available Methods + +The provider offers different methods to access private keys depending on your blockchain needs: + +| Method | Description | Use Case | +| ------------------ | ------------------------------ | ----------------------------------------- | +| `eth_private_key` | Ethereum-formatted private key | EVM chains (Ethereum, Polygon, BSC, etc.) | +| `solanaPrivateKey` | Solana private key | Solana blockchain | +| `private_key` | Raw private key | Any blockchain | + +## EVM Chains (Ethereum, Polygon, BSC, etc.) + +### Get Ethereum Private Key + +```javascript +const privateKey = await provider.request({ method: 'eth_private_key' }) +console.log('Private Key:', privateKey) // 0x1234567890abcdef... +``` + +### Use with Ethers.js + +```javascript +const { ethers } = require('ethers') + +// Get private key +const privateKey = await provider.request({ method: 'eth_private_key' }) + +// Create wallet instance +const wallet = new ethers.Wallet(privateKey) + +// Connect to a provider +const rpcProvider = new ethers.providers.JsonRpcProvider('https://rpc.ankr.com/eth') +const connectedWallet = wallet.connect(rpcProvider) + +// Get address +const address = await connectedWallet.getAddress() +console.log('Wallet Address:', address) + +// Sign a transaction +const tx = { + to: '0x742d35Cc6635C0532925a3b8138341B0F7E8a4e8', + value: ethers.utils.parseEther('0.1'), +} + +const signedTx = await connectedWallet.signTransaction(tx) +const receipt = await connectedWallet.sendTransaction(tx) +``` + +### Use with Viem + +```javascript +const { createWalletClient, createPublicClient, http } = require('viem') +const { privateKeyToAccount } = require('viem/accounts') +const { mainnet } = require('viem/chains') + +// Get private key +const privateKey = await provider.request({ method: 'eth_private_key' }) + +// Create account from private key +const account = privateKeyToAccount(privateKey) + +// Create wallet client +const walletClient = createWalletClient({ + account, + chain: mainnet, + transport: http('https://rpc.ankr.com/eth'), +}) + +// Create public client for reading +const publicClient = createPublicClient({ + chain: mainnet, + transport: http('https://rpc.ankr.com/eth'), +}) + +// Send transaction +const hash = await walletClient.sendTransaction({ + to: '0x742d35Cc6635C0532925a3b8138341B0F7E8a4e8', + value: parseEther('0.1'), +}) +``` + +## Solana Integration + +### Get Solana Private Key + +```javascript +const solanaPrivateKey = await provider.request({ method: 'solanaPrivateKey' }) +console.log('Solana Private Key:', solanaPrivateKey) // Base58 encoded +``` + +### Use with Solana Web3.js + +```javascript +const { + Connection, + Keypair, + PublicKey, + Transaction, + SystemProgram, + LAMPORTS_PER_SOL, +} = require('@solana/web3.js') +const bs58 = require('bs58') + +// Get private key +const solanaPrivateKey = await provider.request({ method: 'solanaPrivateKey' }) + +// Create keypair from private key +const secretKey = bs58.decode(solanaPrivateKey) +const keypair = Keypair.fromSecretKey(secretKey) + +// Connect to Solana +const connection = new Connection('https://api.mainnet-beta.solana.com') + +// Get balance +const balance = await connection.getBalance(keypair.publicKey) +console.log('Balance:', balance / LAMPORTS_PER_SOL, 'SOL') + +// Send transaction +const transaction = new Transaction().add( + SystemProgram.transfer({ + fromPubkey: keypair.publicKey, + toPubkey: new PublicKey('11111111111111111111111111111112'), + lamports: 0.1 * LAMPORTS_PER_SOL, + }) +) + +const signature = await connection.sendTransaction(transaction, [keypair]) +``` + +## Other Blockchains + +### Get Raw Private Key + +```javascript +const rawPrivateKey = await provider.request({ method: 'private_key' }) +console.log('Raw Private Key:', rawPrivateKey) // Hex string +``` + +### Example: Bitcoin Integration + +```javascript +const bitcoin = require('bitcoinjs-lib') + +// Get raw private key +const rawPrivateKey = await provider.request({ method: 'private_key' }) + +// Create Bitcoin keypair +const keyPair = bitcoin.ECPair.fromPrivateKey(Buffer.from(rawPrivateKey.slice(2), 'hex')) + +// Get Bitcoin address +const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey }) +console.log('Bitcoin Address:', address) +``` + +## Disabling Private Key Export + +Private key export can be disabled in the Web3Auth Dashboard: + +1. Go to your project settings +2. Navigate to "Advanced Settings" +3. Toggle "Disable Private Key Export" +4. Save changes + +When disabled, private key methods will throw an error: + +```javascript +try { + const privateKey = await provider.request({ method: 'eth_private_key' }) +} catch (error) { + console.error('Private key export disabled:', error.message) +} +``` diff --git a/ew-sidebar.js b/ew-sidebar.js index e724be4c3e7..0e30a155280 100644 --- a/ew-sidebar.js +++ b/ew-sidebar.js @@ -3,6 +3,7 @@ import { vue, android, ios, + node, reactnative, flutter, unity, @@ -40,24 +41,23 @@ function webTopNavButton(selectedSDK) { - Mobile + Mobile & Gaming - - Gaming + + Backend `; } -function gamingTopNavButton(selectedSDK) { - var gamingSDKs = { - [unity]: `/embedded-wallets/sdk/unity`, - [unreal]: `/embedded-wallets/sdk/unreal`, +function backendTopNavButton(selectedSDK) { + var backendSDKs = { + [node]: `/embedded-wallets/sdk/node`, }; - if (gamingSDKs.hasOwnProperty(selectedSDK)) { - delete gamingSDKs[selectedSDK]; + if (backendSDKs.hasOwnProperty(selectedSDK)) { + delete backendSDKs[selectedSDK]; } - var sdkNames = Object.keys(gamingSDKs); - var sdkLinks = Object.values(gamingSDKs); + // var sdkNames = Object.keys(backendSDKs); + // var sdkLinks = Object.values(backendSDKs); var sdkVersion = getPnPVersion(selectedSDK); return ` @@ -66,14 +66,13 @@ function gamingTopNavButton(selectedSDK) { Web - Mobile + Mobile & Gaming
- Gaming + Backend
v${sdkVersion}
@@ -87,6 +86,8 @@ function mobileTopNavButton(selectedSDK) { [ios]: `/embedded-wallets/sdk/ios`, [reactnative]: `/embedded-wallets/sdk/react-native`, [flutter]: `/embedded-wallets/sdk/flutter`, + [unity]: `/embedded-wallets/sdk/unity`, + [unreal]: `/embedded-wallets/sdk/unreal`, }; if (mobileSDKs.hasOwnProperty(selectedSDK)) { delete mobileSDKs[selectedSDK]; @@ -101,19 +102,21 @@ function mobileTopNavButton(selectedSDK) { Web
- Mobile + Mobile & Gaming
v${sdkVersion}
- - Gaming + + Backend
`; } @@ -168,6 +171,7 @@ const sidebar = { { type: "link", label: "React", href: "/embedded-wallets/sdk/react" }, { type: "link", label: "Vue", href: "/embedded-wallets/sdk/vue" }, { type: "link", label: "JavaScript", href: "/embedded-wallets/sdk/js" }, + { type: "link", label: "Node.js", href: "/embedded-wallets/sdk/node" }, { type: "link", label: "Android", href: "/embedded-wallets/sdk/android" }, { type: "link", label: "iOS", href: "/embedded-wallets/sdk/ios" }, { type: "link", label: "React Native", href: "/embedded-wallets/sdk/react-native" }, @@ -745,7 +749,7 @@ const sidebar = { sdk_unity: [ { type: "html", - value: gamingTopNavButton(unity), + value: mobileTopNavButton(unity), defaultStyle: true, }, "sdk/unity/README", @@ -789,10 +793,32 @@ const sidebar = { href: "https://github.com/Web3Auth/web3auth-unity-sdk/releases", }, ], + sdk_node: [ + { + type: "html", + value: backendTopNavButton(node), + defaultStyle: true, + }, + "sdk/node/README", + "sdk/node/connect", + "sdk/node/blockchain-connection", + "sdk/node/private-key", + "sdk/node/examples", + { + type: "link", + label: "Support Forum", + href: "https://web3auth.io/community/c/help-pnp/pnp-node/21", + }, + { + type: "link", + label: "Release Notes", + href: "https://github.com/Web3Auth/web3auth-backend/releases", + }, + ], sdk_unreal: [ { type: "html", - value: gamingTopNavButton(unreal), + value: mobileTopNavButton(unreal), defaultStyle: true, }, "sdk/unreal/README", diff --git a/src/components/EWSDKCards/SDKOptions.ts b/src/components/EWSDKCards/SDKOptions.ts index e260d96de7f..66f3977fa15 100644 --- a/src/components/EWSDKCards/SDKOptions.ts +++ b/src/components/EWSDKCards/SDKOptions.ts @@ -6,6 +6,7 @@ export const web = 'Web' export const mobile = 'Mobile' export const gaming = 'Gaming' export const enterprise = 'Enterprise' +export const backend = 'Backend' export const android = 'Android' export const ios = 'iOS' export const js = 'Javascript' diff --git a/src/components/EWSDKCards/icons.tsx b/src/components/EWSDKCards/icons.tsx index 41d9f7d1488..804641d5fcc 100644 --- a/src/components/EWSDKCards/icons.tsx +++ b/src/components/EWSDKCards/icons.tsx @@ -270,3 +270,19 @@ export const gamingIcons = ( ) + +export const backendIcons = ( +
+
+ {/* Node.js */} + + + + + + + + +
+
+) diff --git a/src/components/EWSDKCards/index.tsx b/src/components/EWSDKCards/index.tsx index 266c16a9911..0b7a5a5bdbc 100644 --- a/src/components/EWSDKCards/index.tsx +++ b/src/components/EWSDKCards/index.tsx @@ -2,8 +2,8 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ import { useState } from 'react' -import { web, mobile, gaming, enterprise } from './SDKOptions' -import { webIcons, mobileIcons, gamingIcons } from './icons' +import { web, mobile, gaming, backend } from './SDKOptions' +import { webIcons, mobileIcons, gamingIcons, backendIcons } from './icons' import styles from './styles.module.css' const chevron = ( @@ -107,6 +107,27 @@ export const pnpweb = ( +
+
+ + + +
+
+

Node.js SDK

+ +
+
) @@ -293,6 +314,52 @@ export const pnpgaming = ( ) +export const pnpbackend = ( +
+
+
+

Embedded Wallets Backend SDKs

+ {/*
+
{pnp} Only
+
*/} +
+ +

+ Integrate MetaMask Embedded Wallets (Web3Auth) with just 4 lines of code.
+
+ Seamlessly authenticate users into your Web3 apps with their socials using Web3Auth Backend + SDKs. +

+ {backendIcons} +
+ +
+) + // export const mpccorekit = ( //
//
@@ -385,6 +452,11 @@ export default function QuickNavigation() { onClick={() => setPlatform(gaming)}> {gaming}
+
setPlatform(backend)}> + {backend} +
{/*
setPlatform(enterprise)} @@ -396,6 +468,7 @@ export default function QuickNavigation() { {platform === web && pnpweb} {platform === mobile && pnpmobile} {platform === gaming && pnpgaming} + {platform === backend && pnpbackend} {/* {platform === enterprise && mpccorekit} */}
) diff --git a/src/components/NavDropdown/Products.html b/src/components/NavDropdown/Products.html index 43982840b03..b44cdd8ebc8 100644 --- a/src/components/NavDropdown/Products.html +++ b/src/components/NavDropdown/Products.html @@ -183,30 +183,34 @@

JavaScript SDK

  • - + - - + + + + +
    -

    Unity SDK

    +

    Node SDK

  • - + - +
    -

    Unreal SDK

    +

    Unity SDK

  • @@ -266,6 +270,20 @@

    Flutter SDK

    +
  • + + + + + + +
    +

    Unreal SDK

    +
    +
    +
  • diff --git a/src/utils/example-maps.tsx b/src/utils/example-maps.tsx index fcba35f7dc1..8501c0fbec2 100644 --- a/src/utils/example-maps.tsx +++ b/src/utils/example-maps.tsx @@ -806,7 +806,7 @@ export const webExamples: ExamplesInterface[] = [ export const pnpiOSExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP iOS SDK Quick Start', - description: 'A quick integration of Web3Auth Plug and Play iOS SDK', + description: 'A quick integration of MetaMask Embedded Wallets iOS SDK', image: 'img/embedded-wallets/banners/ios-swift.png', type: QUICK_START, tags: [tags.pnp, tags.ios, tags.evm, 'swift'], @@ -859,7 +859,7 @@ export const pnpiOSExamples: ExamplesInterface[] = [ { title: 'Using Aggregate Verifiers in Web3Auth PnP iOS SDK', description: - 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in Web3Auth Plug and Play iOS SDK', + 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in MetaMask Embedded Wallets iOS SDK', image: 'img/embedded-wallets/banners/ios-auth0.png', type: SAMPLE_APP, tags: [ @@ -883,7 +883,7 @@ export const pnpiOSExamples: ExamplesInterface[] = [ export const pnpAndroidExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP Android SDK Quick Start', - description: 'A quick integration of Web3Auth Plug and Play Android SDK', + description: 'A quick integration of MetaMask Embedded Wallets Android SDK', image: 'img/embedded-wallets/banners/android.png', type: QUICK_START, tags: [tags.pnp, tags.android, tags.evm, 'kotlin'], @@ -947,7 +947,7 @@ export const pnpAndroidExamples: ExamplesInterface[] = [ { title: 'Using Aggregate Verifiers in Web3Auth PnP Android SDK', description: - 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in Web3Auth Plug and Play Android SDK', + 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in MetaMask Embedded Wallets Android SDK', image: 'img/embedded-wallets/banners/android-auth0.png', type: SAMPLE_APP, tags: [ @@ -972,7 +972,7 @@ export const pnpReactNativeExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP React Native SDK Quick Start', description: - 'A quick integration of Web3Auth Plug and Play React Native SDK in Android and iOS', + 'A quick integration of MetaMask Embedded Wallets React Native SDK in Android and iOS', image: 'img/embedded-wallets/banners/react-native.png', type: QUICK_START, tags: [tags.pnp, tags.android, tags.ios, tags.evm, tags.reactNative], @@ -984,7 +984,7 @@ export const pnpReactNativeExamples: ExamplesInterface[] = [ { title: 'Using Auth0 with Web3Auth PnP React Native SDK', description: - 'Using Auth0 Single Page App (Implicit Mode) in Web3Auth Plug and Play React Native SDK in Android and iOS', + 'Using Auth0 Single Page App (Implicit Mode) in MetaMask Embedded Wallets React Native SDK in Android and iOS', image: 'img/embedded-wallets/banners/react-native-auth0.png', type: SAMPLE_APP, tags: [tags.pnp, tags.android, tags.ios, tags.reactNative, tags.evm, 'auth0', 'implicit mode'], @@ -996,7 +996,7 @@ export const pnpReactNativeExamples: ExamplesInterface[] = [ { title: 'Using Aggregate Verifiers in Web3Auth PnP React Native SDK', description: - 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in Web3Auth Plug and Play React Native SDK for Android and iOS', + 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in MetaMask Embedded Wallets React Native SDK for Android and iOS', image: 'img/embedded-wallets/banners/react-native-auth0.png', type: SAMPLE_APP, tags: [ @@ -1020,7 +1020,7 @@ export const pnpReactNativeExamples: ExamplesInterface[] = [ }, { title: 'Using Web3Auth PnP React Native SDK in Expo', - description: 'Using Web3Auth Plug and Play React Native SDK in an Expo App', + description: 'Using MetaMask Embedded Wallets React Native SDK in an Expo App', image: 'img/embedded-wallets/banners/expo.png', type: SAMPLE_APP, tags: [tags.pnp, tags.android, tags.ios, tags.evm, tags.reactNative, 'expo'], @@ -1033,7 +1033,7 @@ export const pnpReactNativeExamples: ExamplesInterface[] = [ export const pnpFlutterExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP Flutter SDK Quick Start', - description: 'A quick integration of Web3Auth Plug and Play Flutter SDK for Android and iOS', + description: 'A quick integration of MetaMask Embedded Wallets Flutter SDK for Android and iOS', image: 'img/embedded-wallets/banners/flutter.png', type: QUICK_START, tags: [tags.pnp, tags.flutter, tags.ios, tags.android, tags.evm, 'dart'], @@ -1120,7 +1120,7 @@ export const pnpFlutterExamples: ExamplesInterface[] = [ { title: 'Using Aggregate Verifiers in Web3Auth PnP Flutter SDK', description: - 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in Web3Auth Plug and Play Flutter SDK for Android and iOS', + 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in MetaMask Embedded Wallets Flutter SDK for Android and iOS', image: 'img/embedded-wallets/banners/flutter-auth0.png', type: SAMPLE_APP, tags: [ @@ -1147,7 +1147,7 @@ export const pnpUnityExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP Unity SDK Quick Start', description: - 'A quick integration of Web3Auth Plug and Play Unity SDK in Android, iOS and WebGL', + 'A quick integration of MetaMask Embedded Wallets Unity SDK in Android, iOS and WebGL', image: 'img/embedded-wallets/banners/unity.png', type: QUICK_START, tags: [tags.pnp, tags.unity, 'csharp', tags.android, tags.ios, tags.evm, 'webgl'], @@ -1158,7 +1158,7 @@ export const pnpUnityExamples: ExamplesInterface[] = [ { title: 'Using Auth0 with Web3Auth PnP Unity SDK', description: - 'Using Auth0 Single Page App (Implicit Mode) in Web3Auth Plug and Play Unity SDK in Android, iOS and WebGL', + 'Using Auth0 Single Page App (Implicit Mode) in MetaMask Embedded Wallets Unity SDK in Android, iOS and WebGL', image: 'img/embedded-wallets/banners/unity-auth0.png', type: SAMPLE_APP, tags: [ @@ -1179,7 +1179,7 @@ export const pnpUnityExamples: ExamplesInterface[] = [ { title: 'Using Aggregate Verifiers in Web3Auth PnP Unity SDK', description: - 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in Web3Auth Plug and Play Unity SDK for Android, iOS and WebGL', + 'Combine multiple logins (Google, Facebook and GitHub) using Aggregate Verifiers in MetaMask Embedded Wallets Unity SDK for Android, iOS and WebGL', image: 'img/embedded-wallets/banners/unity-auth0.png', type: SAMPLE_APP, tags: [ @@ -1206,7 +1206,7 @@ export const pnpUnityExamples: ExamplesInterface[] = [ export const pnpUnrealExamples: ExamplesInterface[] = [ { title: 'Web3Auth PnP Unreal Engine SDK Quick Start', - description: 'A quick integration of Web3Auth Plug and Play Unreal Engine SDK in Android & iOS', + description: 'A quick integration of MetaMask Embedded Wallets Unreal Engine SDK in Android & iOS', image: 'img/embedded-wallets/banners/unreal.png', type: QUICK_START, tags: [tags.pnp, tags.unreal, 'csharp', tags.android, tags.evm, tags.ios], @@ -1218,7 +1218,7 @@ export const pnpUnrealExamples: ExamplesInterface[] = [ id: 'unreal-auth0-example', title: 'Using Auth0 with Web3Auth PnP Unreal Engine SDK', description: - 'Using Auth0 Single Page App (Implicit Mode) in Web3Auth Plug and Play Unreal Engine SDK in Android & iOS', + 'Using Auth0 Single Page App (Implicit Mode) in MetaMask Embedded Wallets Unreal Engine SDK in Android & iOS', image: 'img/embedded-wallets/banners/unreal-auth0.png', type: SAMPLE_APP, tags: [tags.pnp, tags.unreal, tags.android, tags.ios, 'auth0', tags.evm, 'implicit mode'], @@ -1229,7 +1229,7 @@ export const pnpUnrealExamples: ExamplesInterface[] = [ id: 'unreal-google-example', title: 'Using Google in Web3Auth PnP Unreal Engine SDK', description: - 'Using Google Custom Authentication in Web3Auth Plug and Play Unreal Engine SDK for Android & iOS', + 'Using Google Custom Authentication in MetaMask Embedded Wallets Unreal Engine SDK for Android & iOS', image: 'img/embedded-wallets/banners/unreal-google.png', type: SAMPLE_APP, tags: [ @@ -1250,288 +1250,54 @@ export const pnpUnrealExamples: ExamplesInterface[] = [ }, ] -export const coreKitSfaiOSExamples: ExamplesInterface[] = [ - { - title: 'Web3Auth Single Factor Auth iOS SDK Quick Start', - description: 'A quick integration of Single Factor Auth iOS SDK', - image: 'img/embedded-wallets/banners/ios-swift.png', - type: QUICK_START, - tags: [tags.sfa, 'sfa', tags.ios, tags.evm, 'swift'], - link: 'https://github.com/Web3Auth/web3auth-ios-examples/tree/main/sfa-ios-quick-start', - id: 'sfa-ios-quick-start', - githubLink: 'https://github.com/Web3Auth/web3auth-ios-examples/tree/main/sfa-ios-quick-start', - }, -] -export const coreKitSfaAndroidExamples: ExamplesInterface[] = [ - { - title: 'Web3Auth Single Factor Auth Android SDK Quick Start', - description: 'A quick integration of Web3Auth Single Factor Auth Android SDK', - image: 'img/embedded-wallets/banners/android.png', - type: QUICK_START, - tags: [tags.sfa, 'sfa', tags.android, tags.evm, 'kotlin'], - link: 'https://github.com/Web3Auth/web3auth-android-examples/tree/main/sfa-android-quick-start', - id: 'sfa-ios-quick-start', - githubLink: - 'https://github.com/Web3Auth/web3auth-android-examples/tree/main/sfa-android-quick-start', - }, -] -export const coreKitSfaReactNativeExamples: ExamplesInterface[] = [ - { - id: 'sfa-rn-bare-quick-start', - title: 'Web3Auth Single Factor Auth React Native SDK Quick Start', - description: - 'A quick integration of Web3Auth Single Factor Auth React Native SDK in Android and iOS', - image: 'img/embedded-wallets/banners/react-native.png', - type: QUICK_START, - tags: [tags.sfa, 'sfa', tags.android, tags.ios, tags.evm, tags.reactNative], - link: 'https://github.com/Web3Auth/web3auth-react-native-examples/tree/main/sfa-rn-bare-quick-start', - githubLink: - 'https://github.com/Web3Auth/web3auth-react-native-examples/tree/main/sfa-rn-bare-quick-start', - }, - { - id: 'sfa-rn-expo-auth0-example', - title: 'Using Web3Auth Single Factor Auth React Native SDK in Expo', - description: 'Using Web3Auth Single Factor Auth React Native SDK in an Expo App', - image: 'img/embedded-wallets/banners/expo.png', - type: SAMPLE_APP, - tags: [tags.sfa, 'sfa', tags.android, tags.ios, tags.reactNative, 'expo'], - link: 'https://github.com/Web3Auth/web3auth-react-native-examples/tree/main/sfa-rn-expo-auth0-example', - githubLink: - 'https://github.com/Web3Auth/web3auth-react-native-examples/tree/main/sfa-rn-expo-auth0-example', - }, -] -export const coreKitSfaFlutterExamples: ExamplesInterface[] = [ - { - id: 'sfa_flutter_quick_start', - title: 'Web3Auth Single Factor Auth Flutter SDK Quick Start', - description: - 'A quick integration of Web3Auth Single Factor Auth Flutter SDK for Android and iOS', - image: 'img/embedded-wallets/banners/flutter.png', - type: QUICK_START, - tags: [tags.sfa, 'sfa', tags.flutter, tags.ios, tags.android, tags.evm, 'dart'], - link: 'https://github.com/Web3Auth/web3auth-flutter-examples/tree/main/sfa_flutter_quick_start', - githubLink: - 'https://github.com/Web3Auth/web3auth-flutter-examples/tree/main/sfa_flutter_quick_start', - }, - { - id: 'sfa_flutter_solana', - title: 'Integrate Web3Auth Single Factor Auth Flutter SDK with Solana Blockchain', - description: 'Use Solana Blockchain with Single Factor Auth Flutter SDK for Android and iOS', - image: 'img/embedded-wallets/banners/flutter-solana.png', - type: SAMPLE_APP, - tags: [tags.sfa, 'sfa', tags.flutter, tags.ios, tags.android, 'dart', tags.solana, 'ed25519'], - link: 'https://github.com/Web3Auth/web3auth-flutter-examples/tree/main/sfa_flutter_solana', - githubLink: - 'https://github.com/Web3Auth/web3auth-flutter-examples/tree/main/sfa_flutter_solana', - }, -] -export const coreKitMPCWebExamples: ExamplesInterface[] = [ +export const pnpNodeExamples: ExamplesInterface[] = [ { - title: 'MPC Core Kit React Quick Start', - description: 'A quick integration of Multi Party Computation Core Kit SDK in React', - image: 'img/embedded-wallets/banners/react.png', - type: QUICK_START, - tags: [ - tags.mpcCoreKit, - 'mpc', - tags.web, - tags.mpcCoreKitJS, - tags.evm, - - 'react', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start', - id: 'mpc-core-kit-react-quick-start', - }, - { - title: 'MPC Core Kit Angular Quick Start', - description: 'A quick integration of Multi Party Computation Core Kit SDK in angular', - image: 'img/embedded-wallets/banners/angular.png', - type: QUICK_START, - tags: [ - tags.mpcCoreKit, - 'mpc', - tags.web, - tags.mpcCoreKitJS, - tags.evm, - - 'angular', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-angular-quick-start', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-angular-quick-start', - id: 'mpc-core-kit-angular-quick-start', - }, - { - title: 'MPC Core Kit Vue Quick Start', - description: 'A quick integration of Multi Party Computation Core Kit SDK in Vue', - image: 'img/embedded-wallets/banners/vue.png', - type: QUICK_START, - tags: [tags.mpcCoreKit, 'mpc', tags.web, tags.mpcCoreKitJS, tags.evm, 'vue', 'id token login'], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-vue-quick-start', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-vue-quick-start', - id: 'mpc-core-kit-vue-quick-start', - }, - { - title: 'MPC Core Kit NextJS Quick Start', - description: 'A quick integration of Multi Party Computation Core Kit SDK in NextJS', - image: 'img/embedded-wallets/banners/next.js.png', - type: QUICK_START, - tags: [ - tags.mpcCoreKit, - 'mpc', - tags.web, - tags.mpcCoreKitJS, - tags.evm, - - 'nextjs', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-nextjs-quick-start', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/quick-starts/mpc-core-kit-nextjs-quick-start', - id: 'mpc-core-kit-nextjs-quick-start', - }, - { - title: 'Use Aggregate Verifiers in MPC Core Kit SDK', - description: - 'Aggregate Google, Auth0 GitHub & Email Passwordless in Multi Party Computation Core Kit SDK', - image: 'img/embedded-wallets/banners/auth0.png', - type: SAMPLE_APP, - tags: [ - tags.mpcCoreKit, - 'mpc', - tags.web, - tags.mpcCoreKitJS, - tags.evm, - - 'aggregate verifier', - 'google', - 'github', - 'email passwordless', - 'auth0', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/blob/main/mpc-core-kit-web/mpc-core-kit-aggregate-verifier-example/', - id: 'mpc-core-kit-aggregate-verifier-example', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/blob/main/mpc-core-kit-web/mpc-core-kit-aggregate-verifier-example/', - }, - { - title: 'Integrate Farcaster Login in MPC Core Kit SDK', - description: 'Use Farcaster with Multi Party Computation Core Kit SDK', - image: 'img/embedded-wallets/banners/farcaster.png', - type: SAMPLE_APP, - tags: [ - tags.mpcCoreKit, - 'mpc', - tags.web, - tags.mpcCoreKitJS, - tags.evm, - - 'farcaster', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/mpc-core-kit-farcaster', - id: 'mpc-core-kit-farcaster', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/mpc-core-kit-farcaster', - }, - { - title: 'Integrate MPC Core Kit SDK with Solana Blockchain', - description: 'Use Solana with MPC Core Kit SDK', - image: 'img/embedded-wallets/banners/solana.png', - type: SAMPLE_APP, - tags: [tags.mpcCoreKit, tags.web, tags.mpcCoreKitJS, tags.evm, tags.solana, 'ed25519'], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/mpc-core-kit-solana', - id: 'mpc-core-kit-solana', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-web/mpc-core-kit-solana', - }, -] -export const coreKitMPCReactNativeExamples: ExamplesInterface[] = [ - { - id: 'mpc-core-kit-rn-quick-start', - title: 'Web3Auth MPC Core Kit React Native Quick Start', + title: 'Web3Auth PnP Node SDK Quick Start', description: - 'A quick integration of Web3Auth Multi Party Computation Core Kit in React Native for Android and iOS', - image: 'img/embedded-wallets/banners/react-native.png', + 'A quick integration of MetaMask Embedded Wallets Node SDK', + image: 'img/embedded-wallets/banners/node.png', type: QUICK_START, - tags: [tags.mpcCoreKit, 'mpc', tags.android, tags.evm, tags.ios, tags.reactNative], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-quick-start', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-quick-start', + tags: [tags.pnp, tags.node, 'nodejs', tags.evm,], + link: 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/evm-quick-start', + id: 'node-quick-start', + githubLink: 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/evm-quick-start', }, { - id: 'mpc-core-kit-rn-auth0', - title: 'Using Auth0 with MPC Core Kit React Native', + title: 'Using Firebase with Web3Auth PnP Node SDK', description: - 'Integrate Auth0 with Web3Auth Multi Party Computation Core Kit in React Native for Android and iOS', - image: 'img/embedded-wallets/banners/react-native-auth0.png', + 'Using Firebase Backend Login in MetaMask Embedded Wallets Node SDK', + image: 'img/embedded-wallets/banners/node-firebase.png', type: SAMPLE_APP, tags: [ - tags.mpcCoreKit, - 'mpc', + tags.pnp, + tags.node, - tags.android, - tags.ios, - tags.reactNative, - tags.evm, - 'auth0', - 'id token login', - ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-auth0', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-auth0', - }, - { - id: 'mpc-core-kit-rn-solana', - title: 'Using Solana MPC Core Kit SDK React Native', - description: 'Integrate Solana with Web3Auth MPC Core Kit in React Native for Android and iOS', - image: 'img/embedded-wallets/banners/solana.png', - type: SAMPLE_APP, - tags: [ - tags.mpcCoreKit, - 'mpc', + 'firebase', - tags.android, - tags.ios, - tags.reactNative, tags.evm, - 'auth0', - 'id token login', ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-solana', - githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-solana', + link: 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/firebase-quick-start', + id: 'node-firebase-example', + githubLink: 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/firebase-quick-start', }, { - id: 'mpc-core-kit-rn-expo-auth0', - title: 'Using MPC Core Kit SDK in Expo', + title: 'Using Solana with Web3Auth PnP Node SDK', description: - 'Integrate Auth0 with Web3Auth MPC Core Kit in React Native Expo for Android and iOS', - image: 'img/embedded-wallets/banners/expo.png', + 'Using Solana with MetaMask Embedded Wallets Node SDK', + image: 'img/embedded-wallets/banners/node-solana.png', type: SAMPLE_APP, tags: [ - tags.mpcCoreKit, - 'mpc', - - tags.android, - tags.ios, - tags.reactNative, - tags.evm, - 'auth0', - 'id token login', + tags.pnp, + tags.node, + 'nodejs', + tags.solana, + 'ed25519', ], - link: 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0', + link: 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/solana-quick-start', + id: 'node-solana-example', githubLink: - 'https://github.com/Web3Auth/mpc-core-kit-examples/tree/main/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0', + 'https://github.com/Web3Auth/web3auth-node-examples/tree/main/solana-quick-start', }, ] @@ -1543,12 +1309,6 @@ export const exampleMap: ExamplesInterface[] = [ ...pnpFlutterExamples, ...pnpUnityExamples, ...pnpUnrealExamples, - ...coreKitSfaiOSExamples, - ...coreKitSfaAndroidExamples, - ...coreKitSfaReactNativeExamples, - ...coreKitSfaFlutterExamples, - ...coreKitMPCWebExamples, - ...coreKitMPCReactNativeExamples, ] function arrayToObjectById(array) { diff --git a/src/utils/w3a-sdk-map.js b/src/utils/w3a-sdk-map.js index 97d7c1365bc..aa7af5d74ce 100644 --- a/src/utils/w3a-sdk-map.js +++ b/src/utils/w3a-sdk-map.js @@ -1,7 +1,7 @@ export const reactJS = 'React' export const angular = 'Angular' export const js = 'Javascript' -export const nodejs = 'Node.js' +export const node = 'Node.js' export const vue = 'Vue' export const web = 'Web' @@ -17,6 +17,7 @@ export const pnpWebVersion = `10.0.x` export const pnpAndroidVersion = `9.1.2` export const pnpIOSVersion = `11.1.0` export const pnpRNVersion = `8.1.x` +export const pnpNodeVersion = `5.0.x` export const pnpFlutterVersion = `6.1.2` export const pnpUnityVersion = `7.0.x` export const pnpUnrealVersion = `4.1.x` @@ -55,6 +56,9 @@ export function getPnPVersion(platform) { if (platform === unreal) { return pnpUnrealVersion } + if (platform === node) { + return pnpNodeVersion + } } export function getSFAVersion(platform) { diff --git a/static/img/embedded-wallets/banners/node-firebase.png b/static/img/embedded-wallets/banners/node-firebase.png new file mode 100644 index 00000000000..2fdd111574f Binary files /dev/null and b/static/img/embedded-wallets/banners/node-firebase.png differ diff --git a/static/img/embedded-wallets/banners/node-solana.png b/static/img/embedded-wallets/banners/node-solana.png new file mode 100644 index 00000000000..c49d6e73e09 Binary files /dev/null and b/static/img/embedded-wallets/banners/node-solana.png differ diff --git a/static/img/embedded-wallets/banners/node.png b/static/img/embedded-wallets/banners/node.png new file mode 100644 index 00000000000..620275a6ead Binary files /dev/null and b/static/img/embedded-wallets/banners/node.png differ