open-index/open-npm huggingface dataset:
npm package: @privy-io/expo
Description: Expo client for the Privy Auth API
Author: privy.io
Latest version: 0.64.1

![Blobby](https://avatars.githubusercontent.com/u/81824329?s=200&v=4)

# @privy-io/expo

The Privy Expo SDK allows you to integrate Privy into a bare React Native or Expo app. With Privy, your app can authenticate your users across email, phone, social, and wallet login methods and securely create embedded wallets for them to take onchain actions.

## Installation

Install along with [peer dependencies](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies) using `npm`:

```sh
npx expo install expo-apple-authentication expo-application expo-crypto expo-linking expo-secure-store expo-web-browser react-native-passkeys react-native-webview @privy-io/expo-native-extensions @privy-io/expo
```

Install [polyfills](https://developer.mozilla.org/en-US/docs/Glossary/Polyfill), these should be imported as early as possible in your application.

```sh
npm i --save fast-text-encoding react-native-get-random-values @ethersproject/shims
```

### Dependencies for `@privy-io/expo/ui`

If you are using the `@privy-io/expo/ui` import, you will need to install the following dependencies:

```sh
npx expo install react-native-svg expo-clipboard react-native-qrcode-styled react-native-safe-area-context viem
```

### Dependencies for `@privy-io/expo/smart-wallets`

If you are using the `@privy-io/expo/smart-wallets` import, you will need to install the following dependencies:

```sh
npx expo install viem permissionless
```

## Usage

See Privy's [Expo SDK guide](https://docs.privy.io/basics/react-native/setup) for setup and usage.

## Changelog

Our [changelog](https://docs.privy.io/changelogs/react-native) contains the latest information about new releases, including features, fixes, and upcoming changes.

We use [Semantic Versioning](https://semver.org/) to track breaking changes.
npm package: @privy-io/expo-native-extensions
Description: Privy's native extensions for the @privy-io/expo SDK.
Author: privy.io
Latest version: 0.0.9

# expo-native-extensions

Privy's Expo native extensions!

## Functions

### Setting iCloud recovery natively

_Only on iOS_

## Installing

This is set as a peer dependency of `@privy-io/expo`, and then explicitly added as a dependency to the codebase that consumes `@privy-io/expo`.
npm package: @privy-io/js-sdk-core
Description: Vanilla JS client for the Privy Auth API
Author: privy.io
Latest version: 0.60.8

# @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

```tsx
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

```tsx
// 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,
});
```

## Changelog

Our [changelog](https://docs.privy.io/changelogs/js-sdk-core) contains the latest information about new releases, including features, fixes, and upcoming changes.

We use [Semantic Versioning](https://semver.org/) to track changes.
npm package: @privy-io/node
Description: The official TypeScript library for the Privy API
Author: Privy API
Latest version: 0.14.0

# Privy's Node / Typescript SDK

[![NPM version](<https://img.shields.io/npm/v/@privy-io/node.svg?label=npm%20(stable)>)](https://npmjs.org/package/@privy-io/node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@privy-io/node)

This library provides convenient access to the Privy REST API from server-side TypeScript or JavaScript.

The REST API documentation can be found on [docs.privy.io](https://docs.privy.io).

It is generated with [Stainless](https://www.stainless.com/).

## Installation

```sh
npm install @privy-io/node
```

## Usage

See Privy's [Node SDK guide](https://docs.privy.io/basics/nodeJS/setup) for setup and usage.

## Requirements

TypeScript >= 4.9 is supported.

The following runtimes are supported:

- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Deno v1.28.0 or higher.
- Bun 1.0 or later.
- Cloudflare Workers.
- Vercel Edge Runtime.
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
- Nitro v2.6 or greater.

> [!WARNING]
> Web browser runtimes aren't supported. The SDK will throw an error if used in a browser environment.

Note that React Native is not supported at this time.

If you are interested in other runtime environments, please open or upvote an issue on GitHub.

## Changelog

Our [changelog](https://docs.privy.io/changelogs/node) contains the latest information about new releases, including features, fixes, and upcoming changes.

We use [Semantic Versioning](https://semver.org/) to track breaking changes.
npm package: @privy-io/privy-browser
Description: Browser client for the Privy API
Latest version: 0.0.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @privy-io/privy-browser

Privy's browser client allows you to interact with the Privy API from broswer clients.

For interacting with user data from a node backend, use [@privy-io/privy-node](https://www.npmjs.com/package/@privy-io/privy-node).

https://www.privy.io

![build](https://github.com/privy-io/privy-js/actions/workflows/tests.yml/badge.svg)
[![npm version](https://badge.fury.io/js/@privy-io%2Fprivy-browser.svg)](https://www.npmjs.com/package/@privy-io/privy-browser)

## Documentation

See https://docs.privy.io/.

## Installation

```
npm i @privy-io/privy-browser
```

## Basic usage

Initialize the Privy client using a session that can fetch tokens from Privy through your backend.

```typescript
import axios from 'axios';
import {PrivyClient, CustomSession} from '@privy-io/privy-browser';

const session = new CustomSession(async function authenticate() {
  const response = await axios.post<{token: string}>(`/your/custom/endpoint`);
  return response.data.token;
});

const client = new PrivyClient({
  session: session,
});
```

Using the Privy client, read and write some data for a given user.

```typescript
const userId = '0x123';

// To write...
const [email, ssn] = await client.put(userId, [
  {field: 'email', value: 'foo@example.com'},
  {field: 'ssn', value: '123-45-6789'},
]);

// To read...
const [email, ssn] = await client.get(userId, ['email', 'ssn']);
console.log(email.text());
console.log(ssn.text());
```

## Testing

The test runner looks for files with a `.test.ts` extension. There are two groups of tests: unit and integration.

### Unit

To run unit tests:

```
npm test
```

### Integration

Some of the tests are currently expected to be run against a running instance of the API.

Reset data in the API instance before running tests, e.g. by recreating and seeding the test database.

To successfully run tests, you will need to create a `.env` file in the root of `./privy-browser` with the following fields:

```
PRIVY_API_URL=<privy api url>
PRIVY_KMS_URL=<privy kms url>
PRIVY_API_KEY=<your public key>
PRIVY_API_SECRET=<your private key>
```

To run integration tests:

```
npm run test-integration
```
npm package: @privy-io/privy-node
Description: Node server-side client for the Privy API
Latest version: 0.0.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @privy-io/privy-node

Privy's Node client allows you to interact with the Privy API from server-side Node applications.

For interacting with user data in the browser, use [@privy-io/privy-browser](https://www.npmjs.com/package/@privy-io/privy-browser).

https://www.privy.io

![build](https://github.com/privy-io/privy-js/actions/workflows/tests.yml/badge.svg)
[![npm version](https://badge.fury.io/js/@privy-io%2Fprivy-node.svg)](https://www.npmjs.com/package/@privy-io/privy-node)


## Documentation

See https://docs.privy.io/.

## Requirements

Node 14 and higher is supported.

## Installation

```
npm i @privy-io/privy-node
```

## Basic usage

Initialize the Privy client using a session that can fetch tokens from Privy through your backend.

```typescript
import {PrivyClient} from '@privy-io/privy-node';

const client = new PrivyClient(
  process.env.PRIVY_API_KEY,
  process.env.PRIVY_API_SECRET,
);
```

Using the Privy node client, configure your Privy datastore.

```typescript
// GET fields
const fields = await client.listFields();

// CREATE new field
const field = await client.createField({name: name, description: 'A field'});

// DELETE access group
await client.deleteAccessGroup(accessGroupId);

// GET permisions for a user
const permissions = await client.getUserPermissions(userId);
```

Using `privy-node`, you can also read and write some data for a given user.

```typescript
const userId = "0x123";

// To write...
const [email, ssn] = await client.put(userId, [
  {field: "email", value: "foo@example.com"},
  {field: "ssn", value: "123-45-6789"},
]);

// To read...
const [email, ssn] = await client.get(userId, ["email", "ssn"]);
console.log(email.text());
console.log(ssn.text());
```

## Testing

The test runner looks for files with a `.test.ts` extension. There are two groups of tests: unit and integration.

### Unit

To run unit tests:

```
npm test
```

### Integration

Some of the tests are currently expected to be run against a running instance of the API. To successfully run those, you will need to create a `.env` file in the root of `./privy-node` with the following fields:

```
PRIVY_API_URL=<privy api url>
PRIVY_KMS_URL=<privy kms url>
PRIVY_API_KEY=<your public key>
PRIVY_API_SECRET=<your private key>
```

To run integration tests:

```
npm run test-integration
```
npm package: @privy-io/react-auth
Description: React client for the Privy Auth API
Author: privy.io
Latest version: 3.21.2

# @privy-io/react-auth

![pitch-2-slide-2](https://user-images.githubusercontent.com/3359083/234168988-04254782-0e67-420a-91f7-8e67b67207e5.png)

The Privy React Auth SDK allows you to authenticate your users with Privy in your React app.

Check out our [demo](https://demo.privy.io/)!

## Changelog

Our [changelog](https://docs.privy.io/reference/sdk/react-auth/changelog) contains the latest information about new releases, including features, fixes, and upcoming changes.

We use [Semantic Versioning](https://semver.org/) to track changes.

## Installing

```sh
pnpm install @privy-io/react-auth
```

## Basic Usage

Setup your integration by wrapping any React components that will use the Privy SDK with the `PrivyProvider`. This gives your wrapped components access to the Privy SDK and authentication context.

```tsx
// Import the PrivyProvider
import {PrivyProvider} from '@privy-io/react-auth';

// Wrap any components that will use the Privy SDK with the PrivyProvider – for example, in your `app` or `index` file
<PrivyProvider appId="<your-privy-app-id>">
  <Component {...pageProps} />
</PrivyProvider>;
```

Now, from within your React components, you can access the Privy SDK via the `usePrivy` hook!

```tsx
// Import the usePrivy hook
import {usePrivy} from '@privy-io/react-auth';

// Call usePrivy() from inside your React components
const {ready, authenticated, user, login, logout} = usePrivy();
```