You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val account =Auth0.getInstance("{YOUR_CLIENT_ID}", "{YOUR_DOMAIN}")
3337
+
account.networkingClient = netClient
3338
+
```
3339
+
3340
+
Interceptors are invoked in the order they were added, after the built-in retry interceptor and before the logging interceptor.
3341
+
3274
3342
### Advanced configuration
3275
3343
3276
3344
For more advanced configuration of the networking client, you can provide a custom implementation of `NetworkingClient`. This may be useful when you wish to reuse your own networking client, configure a proxy, etc.
Copy file name to clipboardExpand all lines: V4_MIGRATION_GUIDE.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,37 @@ implementation 'com.google.code.gson:gson:2.8.9' // your preferred version
96
96
97
97
> **Note:** Pinning or excluding is not recommended long-term, as the SDK has been tested and validated against Gson 2.11.0.
98
98
99
+
### DefaultClient.Builder
100
+
101
+
v4 introduces a `DefaultClient.Builder` for configuring the HTTP client. This replaces the constructor-based approach with a more flexible builder pattern that supports additional options such as write/call timeouts, custom interceptors, and custom loggers.
102
+
103
+
**v3 (constructor-based — deprecated):**
104
+
105
+
```kotlin
106
+
// ⚠️ Deprecated: still compiles but shows a warning
107
+
val client =DefaultClient(
108
+
connectTimeout =30,
109
+
readTimeout =30,
110
+
enableLogging =true
111
+
)
112
+
```
113
+
114
+
**v4 (builder pattern — recommended):**
115
+
116
+
```kotlin
117
+
val client =DefaultClient.Builder()
118
+
.connectTimeout(30)
119
+
.readTimeout(30)
120
+
.writeTimeout(30)
121
+
.callTimeout(120)
122
+
.enableLogging(true)
123
+
.logLevel(HttpLoggingInterceptor.Level.HEADERS)
124
+
.addInterceptor(myCustomInterceptor)
125
+
.build()
126
+
```
127
+
128
+
The legacy constructor is deprecated but **not removed** — existing code will continue to compile and run. Your IDE will show a deprecation warning with a suggested `ReplaceWith` quick-fix to migrate to the Builder.
0 commit comments