Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 915 Bytes

File metadata and controls

32 lines (21 loc) · 915 Bytes

True Network Next UI Package

This is a simple package for using True Network in a frontend app like React / Next JS.

True Network provides the easy-to-use infrastructure for building blockchain-based reputation systems for the internet.

Install the package

Using the @truenetworkio/ui package to your frontend app, and follow these steps:

  • Use AttestationProvider in _app.tsx
// Add these imports.
import '@truenetworkio/ui/styles.css'
import { AttestationProvider } from "@truenetworkio/ui";
import { config } from "@/../true-network/true.config";

// Add the provider tag at the top. 
<AttestationProvider trueConfig={config}>
    <Component {...pageProps} />
</AttestationProvider>;
  • Try on React Hooks (useTrueNetwork)
  // You can use the following helper methods.
  const [{ trueApi, error: es }, { attest, getAttestations }] = useTrueNetwork();