INFO
An example Expo app can be found here.
Using Artico in an Expo App
Artico can be used in an Expo app by using the @config-plugins/react-native-webrtc plugin. Here's a minimal set of steps to get started:
Create a new Expo app
sh
npx create-expo-app my-appsh
yarn create expo-app my-appsh
pnpm create expo-app my-appsh
bun create expo-app my-appInstall dependencies
sh
npx expo install @config-plugins/react-native-webrtc react-native-webrtc expo-clipboard expo-crypto expo-standard-web-crypto @rtco/clientINFO
Please refer to the @config-plugins/react-native-webrtc documentation for more information on how to install and configure react-native-webrtc with Expo.
Add the plugin to your app
js
{
"expo": {
"plugins": [
"expo-router",
"@config-plugins/react-native-webrtc"
]
}
}Add polyfills
ts
import { polyfillWebCrypto } from "expo-standard-web-crypto";
import { registerGlobals } from "react-native-webrtc";
polyfillWebCrypto();
registerGlobals();js
import "./polyfills";
import "expo-router/entry";Make sure to update the main field in your package.json to point to the new index.js file.
json
{
"main": "./index"
}Use Artico in your app
ts
import { Artico } from "@rtco/client";
// ...Run your app
sh
npx expo run:androidsh
npx expo run:ios