-
Adding new credential functionality
- Check
packages/idos-sdk-js/src/credentials/
for existing implementations - Follow patterns in
packages/idos-sdk-js/src/credentials/types.ts
- Update tests in corresponding
.test.ts
files - Validate against
packages/@core/src/schemas/
- Check
-
Modifying authentication flows
- EVM changes: Check
packages/idos-sdk-js/src/auth/evm/
- NEAR changes: Check
packages/idos-sdk-js/src/auth/near/
- Always maintain backward compatibility
- Test with both mainnet and testnet configurations
- EVM changes: Check
-
Updating UI components
- Core components in
apps/idos-enclave/src/components/
- Dashboard components in
apps/idos-data-dashboard/src/components/
- Follow existing styling patterns
- Test across different wallet providers
- Core components in
.env
files for environment configurationpackage.json
for dependenciestsconfig.json
for TypeScript settingsvitest.config.ts
for test configuration- Corresponding test files for modified components
NODE_URL=https://nodes.idos.network
NETWORK=testnet # or mainnet
DEBUG=true # for development
packages/
idos-sdk-js/ # Main SDK implementation
issuer-sdk-js/ # Issuer-specific functionality
consumer-sdk-js/ # Consumer-specific functionality
@core/ # Shared utilities and types
@controllers/ # Web application controllers
apps/
idos-enclave/ # Secure browser context
idos-data-dashboard/ # Main dashboard application
isle/ # Owner flow management
dashboard-for-dapps/ # DApp integration dashboard
examples/ # Implementation examples
consumer-and-issuer/
passporting/
isle-demo/
- Core types → Package implementations → Application usage
- Schema definitions → Validation implementations → Runtime checks
- Controller definitions → UI components → User interactions
- Unit tests: Adjacent to source files (
*.test.ts
) - Integration tests: In
apps/idos-sdk-e2e/specs/
- Component tests: Within each app's test directory
- Mock data: Shared in
packages/@core/src/test/
- Define types in appropriate
@core
package - Implement core logic in relevant SDK package
- Add comprehensive tests
- Update documentation
- Create example implementation
- Review related test files first
- Make changes with test coverage
- Validate against example applications
- Check for breaking changes
- Update documentation
- Run test suite:
pnpm test
- Check type consistency:
pnpm type-check
- Verify examples:
pnpm build && pnpm test:e2e
- Validate documentation accuracy
graph TB
User[User/DApp] --> SDK[idOS SDK]
SDK --> Auth[Authentication]
SDK --> Credentials
SDK --> Grants[Access Grants]
Auth --> Wallet[Web3 Wallet]
Credentials --> Enclave[Secure Enclave]
Grants --> Chain[Blockchain]
-
Enclave Operations
- Password input
- Key derivation
- Encryption/decryption
- Never expose keys or sensitive data
-
Wallet Interactions
- Signature requests
- Chain-specific validations
- Transaction handling
-
Data Protection
- Encrypted storage
- Access control
- Permission validation
-
packages/idos-sdk-js
: Main JavaScript SDK- Authentication handlers
- Credential management
- Access control
- Chain interactions
-
packages/issuer-sdk-js
: Issuer functionality- Credential creation
- Validation logic
- Revocation management
-
packages/consumer-sdk-js
: Consumer features- Credential requesting
- Access grant management
- Data consumption
-
packages/@core
: Shared utilities- Type definitions
- Schema validation
- Common utilities
-
apps/idos-enclave
: Secure browser context- Password handling
- Key derivation
- Cryptographic operations
-
apps/idos-data-dashboard
: Main dashboard- Credential management
- Access control
- User settings
- Web3 wallet integration (EVM/NEAR)
- EIP-191 and NEP-413 signatures
- Secure enclave operations
- Password/passkey encryption
-
Credential System
- CRUD operations
- Encrypted storage
- Verifiable credentials
- Access control
-
Permission Management
- Delegated Write Grants
- Access Grants
- Timelock revocation
- Permission inheritance
-
Authentication Errors
- Check wallet connection
- Verify network configuration
- Validate signature format
- Confirm chain compatibility
-
Credential Operations
- Verify encryption key availability
- Check access permissions
- Validate credential format
- Confirm storage state
-
Access Grant Issues
- Verify timelock status
- Check grant permissions
- Validate chain state
- Confirm signature validity
- Enable debug mode in configuration
- Check browser console for detailed logs
- Verify network requests in DevTools
- Validate state in blockchain explorer
-
Authentication Issues
- Clear local storage
- Reconnect wallet
- Verify network status
-
Credential Access
- Verify encryption keys
- Check access grants
- Validate permissions
-
Transaction Failures
- Check gas settings
- Verify network status
- Validate input data
- Always maintain type safety
- Add comprehensive tests
- Document changes
- Consider backward compatibility
- Never expose encryption keys
- Validate all signatures
- Handle user cancellation
- Implement proper error handling
- Batch blockchain operations
- Implement proper caching
- Optimize cryptographic operations
- Handle concurrent requests
- Package documentation in respective README.md files
- Example implementations in examples/ directory
- Support process: https://github.com/idos-network/.github/blob/main/profile/README.md