Installation
Install the WalletGate TypeScript SDK for seamless EU Digital Identity verification.
Requirements
- Node.js 18+ or modern browser
- TypeScript 4.5+ (recommended)
- npm, yarn, or pnpm
Installation
bash
npm install @walletgate/eudibash
yarn add @walletgate/eudibash
pnpm add @walletgate/eudiQuick Start
typescript
import { WalletGate } from '@walletgate/eudi';
const client = new WalletGate({
apiKey: process.env.WALLETGATE_API_KEY,
});
// Create verification session
const session = await client.createSession({
checks: [{ type: 'age_over', value: 18 }],
});
console.log(session.verificationUrl);Browser Usage
The SDK works in both Node.js and browser environments:
html
<script type="module">
import { WalletGate } from 'https://cdn.skypack.dev/@walletgate/eudi';
const client = new WalletGate({
apiKey: 'wg_test_your_key_here',
});
// Use client...
</script>Never Expose Live Keys in Browser
Only use test keys (wg_test_*) in client-side code. Live keys should stay on your backend.
TypeScript Support
The SDK is written in TypeScript and includes full type definitions:
typescript
import { WalletGate, CreateSessionInput, VerificationSession } from '@walletgate/eudi';
const client = new WalletGate({
apiKey: process.env.WALLETGATE_API_KEY,
});
const input: CreateSessionInput = {
checks: [{ type: 'age_over', value: 18 }],
redirectUrl: 'https://your-app.com/success',
};
const session: VerificationSession = await client.createSession(input);Environment Variables
Store your API keys securely using environment variables:
bash
WALLETGATE_API_KEY=wg_test_your_test_key_herebash
WALLETGATE_API_KEY=wg_live_your_live_key_hereNext Steps
Continue with these guides:
- Getting Started - Quick start guide
- Verification Flow - Understanding the flow
- API Reference - Full API documentation
- Interactive API - Try the API in your browser
Verification
Check that the SDK is installed correctly:
bash
npm list @walletgate/eudiExpected output:
[email protected] /path/to/your/project
└── @walletgate/[email protected]Next Steps
Troubleshooting
Module not found
If you see Cannot find module '@walletgate/eudi':
- Ensure the package is installed:
npm install @walletgate/eudi - Restart your development server
- Clear node_modules and reinstall:
rm -rf node_modules && npm install
TypeScript errors
If you see TypeScript errors:
- Ensure TypeScript 4.5+ is installed:
npm install -D typescript@latest - Update tsconfig.json:json
{ "compilerOptions": { "moduleResolution": "node", "esModuleInterop": true } }
Need Help?
- 📧 Email: [email protected]
- 💬 GitHub Issues
- 📖 FAQ