open-index/open-npm huggingface dataset:
npm package: @revibase/ctap2-js
Description: Passkeys over NFC directly
Latest version: 0.1.1

# @revibase/ctap2-js

This library is for apps that want to talk to a **physical FIDO2/passkey authenticator over NFC** by sending **APDUs** directly.

**License:** MIT

## Install

```bash
pnpm add @revibase/ctap2-js
```

Optional peer (for types): [`@simplewebauthn/browser`](https://simplewebauthn.dev/docs/packages/browser)

```bash
pnpm add @simplewebauthn/browser
```

## Usage

## React Native

Use a library that can send NFC commands like [`react-native-nfc-manager`](https://github.com/revtel/react-native-nfc-manager) with `NfcTech.IsoDep`.

```ts
import { authenticateWithNfc } from "@revibase/ctap2-js";
import NfcManager, { NfcTech } from "react-native-nfc-manager";

async function withIsoDep<T>(
  fn: (tx: (apdu: Uint8Array) => Promise<Uint8Array>) => Promise<T>,
): Promise<T> {
  const store = useNfcAuthPromptStore.getState();
  await NfcManager.start();
  if (Platform.OS === "android") {
    store.setVisible(true);
    store.setCancelSession(() => {
      NfcManager.cancelTechnologyRequest().catch(() => {});
    });
  }
  await NfcManager.requestTechnology(NfcTech.IsoDep, {
    alertMessage: "Hold your security key near the phone",
  });
  const tx = async (apdu: Uint8Array) => {
    return new Uint8Array(await NfcManager.isoDepHandler.transceive([...apdu]));
  };

  try {
    return await fn(tx);
  } finally {
    if (Platform.OS === "android") {
      store.setCancelSession(null);
    }
    await NfcManager.cancelTechnologyRequest().catch(() => {});
  }
}

const request = {
  origin: "your_origin",
  crossOrigin: false,
  rpId: "your_rp_id",
  challenge: "random_challenge_in_base64_url",
};

await withIsoDep((tx) => authenticateWithNfc(request, tx));
```
npm package: @revibase/wallet-adapter
Description: ```bash npm install @revibase/wallet ```
Author: jychab
Latest version: 0.0.26

## Installation

```bash
npm install @revibase/wallet
```

## Quick Start

This SDK requires a Helius RPC endpoint to connect to the Solana network.
You can get one from Helius or any other Solana RPC provider that supports Helius features. (DAS API & Photon RPC)

## Initialize the SDK

```bash
import { initializeMultiWallet } from "@revibase/wallet";

initializeMultiWallet({
  rpcEndpoint: INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE
});
```

## Use with Solana Wallet Adapter

Once initialized, it is now compatible with the Solana Wallet Adapter.
Simply integrate it into your existing Solana wallet flow.

## Example

```bash

import { useEffect } from "react";
import { initializeMultiWallet } from "@revibase/wallet";
import { ConnectionProvider, WalletProvider } from "@solana/wallet-adapter-react";
import { WalletModalProvider, WalletMultiButton } from "@solana/wallet-adapter-react-ui";


export default function App() {

  useEffect(() => {
    initializeMultiWallet({
      rpcEndpoint: INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE
    });
  }, []);


  return (
    <ConnectionProvider endpoint={INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE}>
      <WalletProvider wallets={[]} autoConnect>
        <WalletModalProvider>
          <div>
            <WalletMultiButton />
            {...}
          </div>
        </WalletModalProvider>
      </WalletProvider>
    </ConnectionProvider>
  );
}


```
npm package: @revibase/wallet-sdk
Description: ```bash npm install @revibase/wallet-sdk ```
Author: jychab
Latest version: 2.5.4

## Installation

```bash
npm install @revibase/wallet-sdk
```


## Quick Start

This SDK requires a Helius RPC endpoint to connect to the Solana network.
You can get one from Helius or any other Solana RPC provider that supports Helius features. (DAS API & Photon RPC)


## Initialize the SDK

```bash
import { initializeMultiWallet } from "@revibase/wallet-sdk";

initializeMultiWallet({
  rpcEndpoint: INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE
});
```


## Use with Solana Wallet Adapter

Once initialized, it is now compatible with the Solana Wallet Adapter.
Simply integrate it into your existing Solana wallet flow.


## Example

```bash

import { useEffect } from "react";
import { initializeMultiWallet } from "@revibase/wallet-sdk";
import { ConnectionProvider, WalletProvider } from "@solana/wallet-adapter-react";
import { WalletModalProvider, WalletMultiButton } from "@solana/wallet-adapter-react-ui";


export default function App() {

  useEffect(() => {
    initializeMultiWallet({
      rpcEndpoint: INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE
    });
  }, []);


  return (
    <ConnectionProvider endpoint={INSERT_YOUR_HELIUS_RPC_ENDPOINT_HERE}>
      <WalletProvider wallets={[]} autoConnect>
        <WalletModalProvider>
          <div>
            <WalletMultiButton />
            {...}
          </div>
        </WalletModalProvider>
      </WalletProvider>
    </ConnectionProvider>
  );
}


```