Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@plaza-app/react-native

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plaza-app/react-native

test

latest
npmnpm
Version
0.1.5
Version published
Maintainers
2
Created
Source

@plazaapp/react-native

Plaza React Native Web3 login (Beta)

This library currently only works with Expo-managed workflows.

See the docs for more information, or reach out to us in our Discord for help.

Requirements

Apple: iOS 12+ Android: Custom Tab support

Installation and Prerequisites

npm install @plazaapp/react-native

For this library to work you will need to install this library's peer dependencies (tested with the latest stable version of each):

crypto-browserify, stream-browserify, events, expo-constants, expo-linking, expo-web-browser,

Inside your metro.config.js, add the polyfills:

const path = require("path");

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
      extraNodeModules: {
        ...{
          stream: path.join(__dirname, "node_modules", "stream-browserify"),
          crypto: path.join(__dirname, "node_modules", "crypto-browserify"),
          events: path.join(__dirname, "node_modules", "events"),
        },
      },
    }),
  },
};

Usage

import { Plaza } from '@plaza-app/react-native';

// ...

const plaza = new Plaza("<YOUR PUBLIC API KEY>")


return (
// ...
      <Button
        title="Log in"
        onPress={async () => {
          const { walletAddress, email } = await plaza.login();
        }}
      />
)

Expo linking

If you export your Expo app, you will need to register your app's custom linking scheme for the authentication flow to work:

import { Plaza } from '@plaza-app/react-native'

const Plaza = new Plaza("<YOUR PUBLIC API KEY>", "myapp")

This corresponds to your app's Expo config (app.json / app.config.js):

{
  "expo": {
    "scheme": "myapp"
  }
}

Keywords

react-native

FAQs

Package last updated on 28 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts