@averer/averer-websdk
v2.1.1
Published
[](https://www.npmjs.com/package/@averer/averer-websdk) [](https://www.npmjs.com/package/@averer/averer-websdk)
Downloads
305
Readme
@averer/averer-websdk
A lightweight client-side React SDK that allows developers to integrate Averer's decentralized eligibility verification and Dynamic-based social/email login into any React, Next.js, or Vite application.
Documentation
For full documentation, guides, and API reference, visit docs.averer.co.
Overview
The Averer WebSDK provides a drop-in React component and provider to help your users:
- Log in with email or social accounts (Apple, Twitter/X, Facebook, etc.)
- Connect a wallet via Dynamic Labs
- Verify their eligibility against RWA credential criteria
It's designed for use in any React environment — including Next.js (App Router) and Vite-based apps.
Installation
Install the package from the public npm registry:
npm install @averer/averer-websdkPrerequisites
react(v18.x or higher)react-dom(v18.x or higher)
npm install react react-domQuick Start
Note: To obtain a
configId, please contact Averer support or refer to the documentation.
'use client';
import dynamic from 'next/dynamic';
import {
AvererWebSdk,
AvererSdkProvider,
type SdkQuery,
type SdkSuccessRes,
} from '@averer/averer-websdk';
export default function EligibilityPage() {
const sdkQuery: SdkQuery = [
{
id: 5,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
circuitId: 'credentialAtomicQuerySigV2' as any,
subjectTitle: 'Pass AML & CTF Checks',
query: {
allowedIssuers: ['*'],
type: 'AMLCTFCredential',
context:
'https://raw.githubusercontent.com/redbellynetwork/receptor-schema/refs/heads/main/schemas/json-ld/AMLCTFCredential.jsonld',
skipClaimRevocationCheck: true,
credentialSubject: {
amlCheckStatus: { $eq: 'passed' },
},
},
},
];
const handleSuccess = (data: SdkSuccessRes) => {
if (data.eligibility.passed) {
console.log('Verification successful', data);
}
};
const handleError = (reason: string) => {
console.error('Verification failed:', reason);
};
return (
<AvererSdkProvider configId="your-config-id">
<AvererWebSdk
appName="Refund"
sdkQuery={sdkQuery}
onSuccess={handleSuccess}
onError={handleError}
/>
</AvererSdkProvider>
);
}Resources
License
See LICENSE for details.
