New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@parcnet-js/app-connector-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcnet-js/app-connector-react

React bindings for the Parcnet app connector library.

latest
npmnpm
Version
1.0.5
Version published
Weekly downloads
63
75%
Maintainers
1
Weekly downloads
 
Created
Source

@parcnet-js/app-connector-react

React bindings for the Parcnet app connector library.

Installation

Using npm:

npm install @parcnet-js/app-connector-react

Using yarn:

yarn add @parcnet-js/app-connector-react

Using pnpm:

pnpm add @parcnet-js/app-connector-react

Usage

Basic usage with the ParcnetClientProvider:

import { ParcnetClientProvider } from "@parcnet-js/app-connector-react";
import type { Zapp } from "@parcnet-js/app-connector";

// Create your Zapp instance
const zapp: Zapp = {
  name: "My Zapp Name",
  permissions: {
    REQUEST_PROOF: { collections: ["My Collection"] },
    SIGN_POD: {},
    READ_POD: { collections: ["My Collection"] },
    INSERT_POD: { collections: ["My Collection"] },
    DELETE_POD: { collections: ["My Collection"] },
    READ_PUBLIC_IDENTIFIERS: {}
  }
};

function App() {
  return (
    <ParcnetClientProvider 
      zapp={zapp}
      url="https://zupass.org" // Optional, defaults to https://zupass.org
    >
      {/* Your app content */}
    </ParcnetClientProvider>
  );
}

Using the context in your components:

import { useParcnetClient, ClientConnectionState } from '@parcnet-js/app-connector-react';

function MyComponent() {
  const { connectionState, connect, disconnect, z } = useParcnetClientContext();

  if (connectionState === ClientConnectionState.CONNECTED) {
    // Access the Parcnet API through 'z'
    // e.g. await z.identity.getPublicKey()
  }
}

Documentation

For detailed documentation and API reference, please visit our documentation site.

FAQs

Package last updated on 10 Nov 2024

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