Resolver
The resolver determines which provider adapter to use based on the integration manifest, project environment, and compatibility constraints.
Resolution Flow
Desired State (uaif.json)
↓
Parse Manifest
↓
Detect Project Environment
↓
Check Provider Compatibility
↓
Select Best Provider
↓
Instantiate Adapter
↓
Ready to UseUsage
typescript
import { resolve } from '@uaif/core';
const adapter = await resolve({
segment: 'auth',
manifest: './uaif.json',
});Resolution Rules
- Manifest Priority — Provider specified in
uaif.jsontakes precedence - Compatibility Check — Provider must be compatible with the current target
- Version Matching — SDK version must satisfy peer dependency constraints
- Context Match — Provider must support the current context (web, mobile, server)
- Fallback — If preferred provider is incompatible, the resolver reports the conflict
Error Handling
typescript
try {
const adapter = await resolve({ segment: 'auth' });
} catch (error) {
if (error.code === 'INCOMPATIBLE_PROVIDER') {
console.log('Provider not compatible with current target');
console.log('Suggestions:', error.suggestions);
}
}