expo-cronet
v0.1.1
Published
Expo config plugin to enable Cronet (HTTP/3) for React Native networking
Maintainers
Readme
expo-cronet
Expo config plugin to enable Cronet for React Native networking, bringing HTTP/3 (QUIC) support to your app.
Installation
npx expo install expo-cronetSetup
Add the plugin to your app.json or app.config.js:
{
"expo": {
"plugins": ["expo-cronet"]
}
}Then run prebuild:
npx expo prebuildConfiguration
You can customize the Cronet configuration:
{
"expo": {
"plugins": [
[
"expo-cronet",
{
"provider": "play-services",
"enableBrotli": true,
"enableQuic": true,
"enableHttp2": true
}
]
]
}
}Options
| 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 |
How it works
This plugin modifies your Android app to use Cronet as the HTTP client:
- Adds Cronet dependencies to
build.gradle - Initializes
CronetEngineinMainApplication.onCreate() - Sets a custom
OkHttpClientFactorythat uses Cronet
All network requests made via fetch() (both React Native's built-in and expo/fetch) will automatically use Cronet.
Requirements
- Expo SDK 52+
- Android only (iOS not supported, uses native networking)
License
MIT
