@@ -34,23 +34,22 @@ export default function Home() {
3434 const proofRequest = await ReclaimProofRequest . init (
3535 process . env . NEXT_PUBLIC_RECLAIM_APP_ID ! ,
3636 process . env . NEXT_PUBLIC_RECLAIM_APP_SECRET ! ,
37- '5eb7f8b3-cbe8-4001-848e-cb161e53fe60' , // providerId
38- // Uncomment the following line to enable logging and AI providers
39- // { log: true, acceptAiProviders: true }
37+ process . env . NEXT_PUBLIC_RECLAIM_PROVIDER_ID ! ,
38+ { log : true }
4039 )
4140 setReclaimProofRequest ( proofRequest )
4241
4342 // Add context to the proof request (optional)
4443 proofRequest . addContext ( '0x00000000000' , 'Example context message' )
4544
4645 // Set parameters for the proof request (if needed)
47- // proofRequest.setParams({ email : "test @example .com", userName: "testUser " })
46+ // proofRequest.setParams({ key : "value " })
4847
4948 // Set a redirect URL (if needed)
50- // proofRequest.setRedirectUrl('https://example.com/ redirect')
49+ // proofRequest.setRedirectUrl('your- redirect-url ')
5150
5251 // Set a custom app callback URL (if needed)
53- // proofRequest.setAppCallbackUrl('https:// your-website.com/ callback')
52+ // proofRequest.setAppCallbackUrl('your-callback-url ')
5453
5554 // Uncomment the following line to log the proof request and to get the Json String
5655 // console.log('Proof request initialized:', proofRequest.toJsonString())
@@ -76,15 +75,19 @@ export default function Home() {
7675
7776 // Start the verification session
7877 await reclaimProofRequest . startSession ( {
79- onSuccess : async ( proof : Proof | string | undefined ) => {
78+ onSuccess : async ( proof : Proof | Proof [ ] | string | undefined ) => {
8079 if ( proof && typeof proof === 'string' ) {
8180 // When using a custom callback url, the proof is returned to the callback url and we get a message instead of a proof
8281 console . log ( 'SDK Message:' , proof )
8382 setExtracted ( proof )
8483 } else if ( proof && typeof proof !== 'string' ) {
8584 // When using the default callback url, we get a proof
86- console . log ( 'Proof received:' , proof ?. claimData . context )
87- setExtracted ( JSON . stringify ( proof ?. claimData . context ) )
85+ console . log ( 'Proof received:' , proof )
86+ if ( Array . isArray ( proof ) ) {
87+ setExtracted ( JSON . stringify ( proof . map ( p => p . claimData . context ) ) )
88+ } else {
89+ setExtracted ( JSON . stringify ( proof ?. claimData . context ) )
90+ }
8891 }
8992 } ,
9093 onError : ( error : Error ) => {
0 commit comments