### Install expo-file-system package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-file-system library into an existing project.
```bash
npx expo install expo-file-system
```
--------------------------------
### Install react-native-keyboard-controller
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the react-native-keyboard-controller package using the Expo CLI.
```bash
npx expo install react-native-keyboard-controller
```
--------------------------------
### Install Expo Server
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-server package into an existing Expo project.
```shell
npx expo install expo-server
```
--------------------------------
### Install expo-clipboard package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-clipboard library into an existing Expo or React Native project.
```bash
npx expo install expo-clipboard
```
--------------------------------
### Install Expo Camera
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-camera package using the Expo CLI.
```bash
npx expo install expo-camera
```
--------------------------------
### Install react-native-webview
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the react-native-webview library into an Expo project using the expo CLI.
```shell
npx expo install react-native-webview
```
--------------------------------
### Install expo-system-ui
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-system-ui package into an existing Expo or React Native project.
```shell
npx expo install expo-system-ui
```
--------------------------------
### Install Expo Checkbox
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-checkbox package into an existing Expo project.
```bash
npx expo install expo-checkbox
```
--------------------------------
### Install expo-image-picker
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-image-picker package into an Expo project.
```shell
npx expo install expo-image-picker
```
--------------------------------
### Install expo-blur package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-blur package using the Expo CLI.
```sh
npx expo install expo-blur
```
--------------------------------
### Install Expo Speech
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-speech package into an existing Expo project.
```bash
npx expo install expo-speech
```
--------------------------------
### Install Expo package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the core Expo package into your project using the Expo CLI.
```shell
npx expo install expo
```
--------------------------------
### Install Expo Packages
Source: https://docs.expo.dev/llms-sdk.txt
Commands to install the expo-dev-menu or expo-dev-client libraries into an existing Expo or React Native project.
```shell
npx expo install expo-dev-menu
```
```shell
npx expo install expo-dev-client
```
```shell
npx expo install expo-device
```
--------------------------------
### Install Expo DocumentPicker
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-document-picker package into an Expo project using the npx expo CLI.
```shell
npx expo install expo-document-picker
```
--------------------------------
### Install Expo Linking
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-linking package into an existing Expo or React Native project.
```bash
npx expo install expo-linking
```
--------------------------------
### Install Expo Libraries via CLI
Source: https://docs.expo.dev/llms-sdk.txt
Standard command to install Expo-compatible libraries into a project using the Expo CLI.
```shell
npx expo install react-native-screens
```
```shell
npx expo install expo-secure-store
```
--------------------------------
### Install Expo TaskManager
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-task-manager package into an existing Expo or React Native project.
```bash
npx expo install expo-task-manager
```
--------------------------------
### Install SASS support
Source: https://docs.expo.dev/llms-sdk.txt
Install the necessary SASS package to enable SCSS/SASS support in an Expo project.
```bash
yarn add -D sass
```
--------------------------------
### Install expo-constants package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-constants library into an existing Expo or React Native project.
```shell
npx expo install expo-constants
```
--------------------------------
### Install react-native-safe-area-context
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the safe area context library into an Expo project using the Expo CLI.
```bash
npx expo install react-native-safe-area-context
```
--------------------------------
### Install Expo Manifests Library
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-manifests package into an existing Expo or React Native project.
```shell
npx expo install expo-manifests
```
--------------------------------
### Expo Secure Store Usage Example (React Native)
Source: https://docs.expo.dev/llms-sdk.txt
This React Native code demonstrates how to use `expo-secure-store` to save and retrieve key-value pairs. It includes functions for saving items (`save`) and getting items (`getValueFor`), along with UI components (TextInput, Button) for user interaction. Ensure `expo-secure-store` is installed in your project.
```jsx
import { useState } from 'react';
import { Text, View, StyleSheet, TextInput, Button } from 'react-native';
import * as SecureStore from 'expo-secure-store';
async function save(key, value) {
await SecureStore.setItemAsync(key, value);
}
async function getValueFor(key) {
let result = await SecureStore.getItemAsync(key);
if (result) {
alert("\uD83D\uDD10 Here's your value \uD83D\uDD10 \n" + result);
} else {
alert('No values stored under that key.');
}
}
export default function App() {
const [key, onChangeKey] = useState('Your key here');
const [value, onChangeValue] = useState('Your value here');
return (
Save an item, and grab it later!
{Add some TextInput components... }
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
paddingTop: 10,
backgroundColor: '#ecf0f1',
padding: 8,
},
paragraph: {
marginTop: 34,
margin: 24,
fontSize: 18,
fontWeight: 'bold',
textAlign: 'center',
},
textInput: {
height: 35,
borderColor: 'gray',
borderWidth: 0.5,
padding: 4,
},
});
```
--------------------------------
### Install Expo Haptics
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-haptics package into your project using the Expo CLI. For existing React Native projects without Expo, additional setup for Expo modules is required.
```bash
npx expo install expo-haptics
```
--------------------------------
### Install Expo IntentLauncher
Source: https://docs.expo.dev/llms-sdk.txt
This command installs the expo-intent-launcher package using the Expo CLI. Ensure you are in your project directory. For bare React Native projects, additional setup for Expo modules might be required.
```sh
npx expo install expo-intent-launcher
```
--------------------------------
### Wavy Progress Indicator Example (React Native)
Source: https://docs.expo.dev/llms-sdk.txt
Demonstrates how to use LinearWavyProgressIndicator and CircularWavyProgressIndicator components in a React Native application. These components require installation of '@expo/ui/jetpack-compose'. The example shows basic usage within a Host and Column layout.
```tsx
import {
Host,
LinearWavyProgressIndicator,
CircularWavyProgressIndicator,
Column,
} from '@expo/ui/jetpack-compose';
export default function WavyExample() {
return (
);
}
```
--------------------------------
### Initialize WebGL Context with GLView
Source: https://docs.expo.dev/llms-sdk.txt
Demonstrates how to set up a basic WebGL rendering pipeline using GLView, including shader compilation and drawing a point.
```jsx
import { View } from 'react-native';
import { GLView } from 'expo-gl';
export default function App() {
return (
);
}
function onContextCreate(gl) {
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
gl.clearColor(0, 1, 1, 1);
const vert = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vert, `void main(void) { gl_Position = vec4(0.0, 0.0, 0.0, 1.0); gl_PointSize = 150.0; }`);
gl.compileShader(vert);
const frag = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(frag, `void main(void) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); }`);
gl.compileShader(frag);
const program = gl.createProgram();
gl.attachShader(program, vert);
gl.attachShader(program, frag);
gl.linkProgram(program);
gl.useProgram(program);
gl.clear(gl.COLOR_BUFFER_BIT);
gl.drawArrays(gl.POINTS, 0, 1);
gl.flush();
gl.endFrameEXP();
}
```
--------------------------------
### Expo CLI Commands and Usage
Source: https://docs.expo.dev/llms-sdk.txt
Examples of how to invoke the Expo CLI to view help documentation and available commands.
```sh
npx expo -h
npx expo login -h
```
--------------------------------
### Icon Component API Usage
Source: https://docs.expo.dev/llms-sdk.txt
Provides a basic example of the `Icon` component's API usage, demonstrating how to import and render an icon with its source. This serves as a minimal starting point for integrating the component.
```tsx
import { Icon } from 'expo-ui';
```
--------------------------------
### Configure expo-widgets in app.json
Source: https://docs.expo.dev/llms-sdk.txt
Examples of defining widget configurations within the Expo app.json file using the config plugin. This includes basic setup and advanced configurations with multiple widget types and custom identifiers.
```json
{
"expo": {
"plugins": [
[
"expo-widgets",
{
"widgets": [
{
"name": "MyWidget",
"displayName": "My Widget",
"description": "A sample home screen widget",
"supportedFamilies": ["systemSmall", "systemMedium", "systemLarge"]
}
]
}
]
]
}
}
```
```json
{
"expo": {
"plugins": [
[
"expo-widgets",
{
"bundleIdentifier": "com.example.myapp.widgets",
"groupIdentifier": "group.com.example.myapp",
"enablePushNotifications": true,
"widgets": [
{
"name": "StatusWidget",
"displayName": "Status",
"description": "Shows your current status at a glance",
"contentMarginsDisabled": true,
"supportedFamilies": ["systemSmall", "systemMedium"]
},
{
"name": "DetailWidget",
"displayName": "Details",
"description": "Shows detailed information",
"supportedFamilies": ["systemMedium", "systemLarge"]
},
{
"name": "LockScreenWidget",
"displayName": "Quick View",
"description": "View info on your Lock Screen",
"supportedFamilies": ["accessoryCircular", "accessoryRectangular", "accessoryInline"]
}
]
}
]
]
}
}
```
--------------------------------
### Usage
Source: https://docs.expo.dev/llms-sdk.txt
Example of how to implement the Sign in with Apple button and handle the authentication flow.
```APIDOC
## Usage
Import the library and use the `AppleAuthenticationButton` component.
```jsx
import * as AppleAuthentication from 'expo-apple-authentication';
import { View, StyleSheet } from 'react-native';
export default function App() {
return (
{
try {
const credential = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
});
// signed in
console.log(credential);
} catch (e) {
if (e.code === 'ERR_REQUEST_CANCELED') {
// handle that the user canceled the sign-in flow
console.log('User canceled sign-in');
} else {
// handle other errors
console.error('Apple Sign In Error:', e);
}
}
}}
/>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
button: {
width: 200,
height: 44,
},
});
```
```
--------------------------------
### Bootstrap a new Expo project
Source: https://docs.expo.dev/llms-sdk.txt
Commands to initialize a new React Native application with the Expo SDK. These tools automate the setup of native code and project structure.
```bash
npx create-expo-app
yarn create expo-app
npm create expo-app
```
--------------------------------
### Access Android Color Control Normal (React Native)
Source: https://docs.expo.dev/llms-sdk.txt
This code example shows how to get the `colorControlNormal` attribute from Android's theme in React Native using `PlatformColor`. This attribute defines the default color for enabled but not activated controls.
```javascript
import { PlatformColor } from 'react-native';
const colorControlNormal = PlatformColor('?attr/colorControlNormal');
```
--------------------------------
### Listen to Video Player Events with Player.addListener (React Native)
Source: https://docs.expo.dev/llms-sdk.txt
This React Native example illustrates the manual approach to listening for 'statusChange' events using the 'player.addListener' method. It requires explicit setup and cleanup of the event subscription within a `useEffect` hook to prevent memory leaks. This method offers the most flexibility but involves more boilerplate code.
```tsx
// ...Imports, definition of the component, creating the player etc.
useEffect(() => {
const subscription = player.addListener('statusChange', ({ status, error }) => {
setPlayerStatus(status);
setPlayerError(error);
console.log('Player status changed: ', status);
});
return () => {
subscription.remove();
};
}, []);
// Rest of the component...
```
--------------------------------
### Install expo-font package
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-font library into an Expo project using the npx expo install utility.
```shell
npx expo install expo-font
```
--------------------------------
### Install and Import Expo SDK Packages
Source: https://docs.expo.dev/llms-sdk.txt
Demonstrates how to install specific Expo SDK packages using the CLI and import them into a JavaScript or TypeScript file for use.
```shell
npx expo install expo-camera expo-contacts expo-sensors
```
```javascript
import { CameraView } from 'expo-camera';
import * as Contacts from 'expo-contacts';
import { Gyroscope } from 'expo-sensors';
```
--------------------------------
### Initialize a new Expo project via CLI
Source: https://docs.expo.dev/llms-sdk.txt
Commands to scaffold a new Expo project using different package managers. These commands support template selection to define the project structure and SDK version.
```sh
# npm
npx create-expo-app@latest --template default@sdk-55
# yarn
yarn create expo-app --template default@sdk-55
# pnpm
pnpm create expo-app --template default@sdk-55
# bun
bun create expo --template default@sdk-55
```
--------------------------------
### Install Expo ScreenCapture
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-screen-capture library into your Expo project. For existing React Native apps, ensure Expo is installed.
```bash
npx expo install expo-screen-capture
```
--------------------------------
### Install Expo LocalAuthentication
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-local-authentication package using the Expo CLI. This command ensures the correct version is installed for your project.
```bash
npx expo install expo-local-authentication
```
--------------------------------
### Install Expo SplashScreen
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-splash-screen package using the Expo CLI. This command ensures that the correct version compatible with your Expo project is installed.
```sh
npx expo install expo-splash-screen
```
--------------------------------
### Configure Server Adapter
Source: https://docs.expo.dev/llms-sdk.txt
Example of initializing a request handler using an adapter, specifically for Node.js HTTP, pointing to the server build directory.
```typescript
import path from 'node:path';
import { createRequestHandler } from 'expo-server/adapter/http';
const onRequest = createRequestHandler({
build: path.join(process.cwd(), 'dist/server'),
environment: process.env.NODE_ENV,
});
```
--------------------------------
### Install Expo Localization
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-localization library in an Expo project. For bare React Native projects, ensure Expo is installed first.
```sh
npx expo install expo-localization
```
--------------------------------
### Install Expo KeepAwake
Source: https://docs.expo.dev/llms-sdk.txt
Command to install the expo-keep-awake package using npm or yarn. Ensure Expo is installed in existing React Native apps.
```sh
npx expo install expo-keep-awake
```
--------------------------------
### Create a Responsive Widget Layout with Expo Widgets
Source: https://docs.expo.dev/llms-sdk.txt
This example demonstrates how to create a responsive widget that adapts its layout based on the `widgetFamily` from the `WidgetEnvironment`. It shows conditional rendering for 'systemSmall', 'systemMedium', and other widget sizes, providing different information displays. It also includes an example of updating the snapshot for this responsive widget.
```tsx
import { HStack, Text, VStack } from '@expo/ui/swift-ui';
import { createWidget, type WidgetEnvironment } from 'expo-widgets';
type WeatherWidgetProps = {
temperature: number;
condition: string;
};
const WeatherWidget = (props: WeatherWidgetProps, environment: WidgetEnvironment) => {
'widget';
// Render different layouts based on size
if (environment.widgetFamily === 'systemSmall') {
return (
{props.temperature}°
);
}
if (environment.widgetFamily === 'systemMedium') {
return (
{props.temperature}°{props.condition}
);
}
// systemLarge and others
return (
Temperature: {props.temperature}°Condition: {props.condition}Updated: {environment.date.toLocaleTimeString()}
);
};
const Widget = createWidget('WeatherWidget', WeatherWidget);
export default Widget;
Widget.updateSnapshot({
temperature: 72,
condition: 'Sunny',
});
```
--------------------------------
### Install expo-brownfield
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-brownfield package using the Expo CLI. Ensure you have Expo installed in your project if integrating into an existing React Native app.
```bash
npx expo install expo-brownfield
```
--------------------------------
### POST WebBrowser.warmUpAsync
Source: https://docs.expo.dev/llms-sdk.txt
Pre-initializes the browser process to reduce latency when opening URLs.
```APIDOC
## POST WebBrowser.warmUpAsync
### Description
Calls the warmUp method on the CustomTabsClient to prepare the browser for faster loading.
### Method
POST
### Endpoint
WebBrowser.warmUpAsync(browserPackage)
### Parameters
#### Path Parameters
- **browserPackage** (string) - Optional - The package name of the browser to warm up. If omitted, the preferred browser is used.
### Request Example
{
"browserPackage": "com.android.chrome"
}
### Response
#### Success Response (200)
- **result** (WebBrowserWarmUpResult) - The result of the warm-up operation.
#### Response Example
{
"result": "success"
}
```
--------------------------------
### Install Expo Calendar
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-calendar library using the Expo CLI. If integrating into an existing React Native app without Expo, ensure Expo is installed.
```sh
npx expo install expo-calendar
```
--------------------------------
### Install Expo package
Source: https://docs.expo.dev/llms-sdk.txt
Command to add the expo package to a project using Yarn.
```sh
yarn add expo
```
--------------------------------
### Install Expo ScreenOrientation
Source: https://docs.expo.dev/llms-sdk.txt
Installs the expo-screen-orientation library using the Expo CLI. If integrating into an existing React Native app without Expo, ensure Expo is installed in the project.
```sh
npx expo install expo-screen-orientation
```
--------------------------------
### Project naming prompt
Source: https://docs.expo.dev/llms-sdk.txt
Example of the interactive prompt displayed by the CLI to capture the project name.
```text
What is your app named? my-app
```
--------------------------------
### Retrieve Android Install Referrer
Source: https://docs.expo.dev/llms-sdk.txt
Fetches the referrer URL associated with the app installation via the Google Play Store Install Referrer API. This method is specific to the Android platform.
```typescript
await Application.getInstallReferrerAsync();
// "utm_source=google-play&utm_medium=organic"
```