-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-worldid-setup.js
More file actions
59 lines (50 loc) · 1.82 KB
/
test-worldid-setup.js
File metadata and controls
59 lines (50 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Quick test to verify World ID environment variables
// Run with: node test-worldid-setup.js
require('dotenv').config();
console.log('\n🔍 Testing World ID Setup...\n');
const appId = process.env.NEXT_PUBLIC_WORLD_ID_APP_ID;
const rpId = process.env.NEXT_PUBLIC_WORLD_RP_ID;
console.log('Environment Variables:');
console.log('---------------------');
console.log('NEXT_PUBLIC_WORLD_ID_APP_ID:', appId || '❌ NOT SET');
console.log('NEXT_PUBLIC_WORLD_RP_ID:', rpId || '❌ NOT SET');
console.log('');
// Validate
let hasErrors = false;
if (!appId) {
console.log('❌ ERROR: NEXT_PUBLIC_WORLD_ID_APP_ID is not set');
hasErrors = true;
} else if (!appId.startsWith('app_')) {
console.log('❌ ERROR: NEXT_PUBLIC_WORLD_ID_APP_ID should start with "app_"');
hasErrors = true;
} else {
console.log('✅ NEXT_PUBLIC_WORLD_ID_APP_ID is valid');
}
if (!rpId) {
console.log('❌ ERROR: NEXT_PUBLIC_WORLD_RP_ID is not set');
hasErrors = true;
} else if (!rpId.startsWith('rp_')) {
console.log('❌ ERROR: NEXT_PUBLIC_WORLD_RP_ID should start with "rp_"');
hasErrors = true;
} else {
console.log('✅ NEXT_PUBLIC_WORLD_RP_ID is valid');
}
console.log('');
if (hasErrors) {
console.log('❌ Setup has errors. Please fix the issues above.');
console.log('');
console.log('Expected values:');
console.log('NEXT_PUBLIC_WORLD_ID_APP_ID=app_7141eab28d3662245856d528b69d89e4');
console.log('NEXT_PUBLIC_WORLD_RP_ID=rp_c7db831223d44723');
process.exit(1);
} else {
console.log('✅ All checks passed!');
console.log('');
console.log('Next steps:');
console.log('1. Restart your dev server: npm run dev');
console.log('2. Navigate to http://localhost:3000/dashboard');
console.log('3. Connect your wallet');
console.log('4. Click "Verify with World ID"');
console.log('5. QR code should appear');
process.exit(0);
}