Difficulty: Hard
Type: Maintenance
Summary
Add a typed configuration layer for API URL, chain ID, app mode, and future mobile integration settings. This avoids silently falling back to production defaults when local or release configuration is missing.
Current Behaviour
guildPassClient reads apiUrl and chainId directly from Constants.expoConfig?.extra, falling back to https://api.guildpass.xyz and chain ID 8453. Settings reads similar values directly for display.
Expected Behaviour
App configuration should be parsed and validated once, then consumed through a typed module. Invalid values should fail clearly in development and use safe release defaults only when explicitly intended.
Suggested Implementation
Create a src/config/appConfig.ts module. Validate API URL format, numeric chain ID, app environment, and optional feature flags. Update SDK client creation and settings display to use the typed config.
Files or Areas Likely Affected
src/lib/guildpassClient.ts
app/settings.tsx
app.json
.env.example
src/config/
README.md
Acceptance Criteria
Additional Notes
Assumption: the current production API fallback is useful for demos but unsafe as an implicit default in all builds.
Difficulty: Hard
Type: Maintenance
Summary
Add a typed configuration layer for API URL, chain ID, app mode, and future mobile integration settings. This avoids silently falling back to production defaults when local or release configuration is missing.
Current Behaviour
guildPassClientreadsapiUrlandchainIddirectly fromConstants.expoConfig?.extra, falling back tohttps://api.guildpass.xyzand chain ID8453. Settings reads similar values directly for display.Expected Behaviour
App configuration should be parsed and validated once, then consumed through a typed module. Invalid values should fail clearly in development and use safe release defaults only when explicitly intended.
Suggested Implementation
Create a
src/config/appConfig.tsmodule. Validate API URL format, numeric chain ID, app environment, and optional feature flags. Update SDK client creation and settings display to use the typed config.Files or Areas Likely Affected
src/lib/guildpassClient.tsapp/settings.tsxapp.json.env.examplesrc/config/README.mdAcceptance Criteria
.env.exampledocuments supported valuesAdditional Notes
Assumption: the current production API fallback is useful for demos but unsafe as an implicit default in all builds.