Expo config plugin to enable Cronet (HTTP/3) for React Native networking
npm install expo-cronetExpo config plugin to enable Cronet for React Native networking, bringing HTTP/3 (QUIC) support to your app.
``bash`
npx expo install expo-cronet
Add the plugin to your app.json or app.config.js:
`json`
{
"expo": {
"plugins": ["expo-cronet"]
}
}
Then run prebuild:
`bash`
npx expo prebuild
You can customize the Cronet configuration:
`json`
{
"expo": {
"plugins": [
[
"expo-cronet",
{
"provider": "play-services",
"enableBrotli": true,
"enableQuic": true,
"enableHttp2": true
}
]
]
}
}
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| provider | 'play-services' \| 'embedded' | 'play-services' | Cronet provider. play-services uses Google Play Services (smaller APK), embedded bundles Cronet in APK (~1-2MB larger) |enableBrotli
| | boolean | true | Enable Brotli compression |enableQuic
| | boolean | true | Enable QUIC protocol (HTTP/3) |enableHttp2
| | boolean | true | Enable HTTP/2 protocol |
This plugin modifies your Android app to use Cronet as the HTTP client:
1. Adds Cronet dependencies to build.gradleCronetEngine
2. Initializes in MainApplication.onCreate()OkHttpClientFactory
3. Sets a custom that uses Cronet
All network requests made via fetch() (both React Native's built-in and expo/fetch`) will automatically use Cronet.
- Expo SDK 52+
- Android only (iOS not supported, uses native networking)
MIT