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.
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();