Skip to content

Commit 3f6c092

Browse files
committed
refactor(config): improve SendGrid API URL config
- Moved SendGrid base URL to config. - Updated HttpClient base URL usage.
1 parent 35d3f02 commit 3f6c092

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/config/app_dependencies.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ class AppDependencies {
170170
// Configure the HTTP client for SendGrid.
171171
// The HtHttpClient's AuthInterceptor will use the tokenProvider to add
172172
// the 'Authorization: Bearer <SENDGRID_API_KEY>' header.
173+
final sendGridApiBase =
174+
EnvironmentConfig.sendGridApiUrl ?? 'https://api.sendgrid.com';
173175
final sendGridHttpClient = HtHttpClient(
174-
baseUrl:
175-
EnvironmentConfig.sendGridApiUrl ?? 'https://api.sendgrid.com/v3',
176+
baseUrl: '$sendGridApiBase/v3',
176177
tokenProvider: () async => EnvironmentConfig.sendGridApiKey,
177178
isWeb: false, // This is a server-side implementation.
178179
logger: Logger('HtEmailSendgridClient'),

0 commit comments

Comments
 (0)