Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add CaiZongyuan/EfficientCC --skill "expo-sdk"
Install specific skill from multi-skill repository
# Description
This skill should be used when users need to work with Expo SDK and Expo Router for building React Native applications. It provides comprehensive guidance on navigation patterns, media handling (camera, image, video, audio), data storage (SQLite, filesystem, SecureStore), authentication, device features (location, notifications, biometrics), and third-party integrations (Stripe, linking, sharing).
# SKILL.md
name: expo-sdk
description: This skill should be used when users need to work with Expo SDK and Expo Router for building React Native applications. It provides comprehensive guidance on navigation patterns, media handling (camera, image, video, audio), data storage (SQLite, filesystem, SecureStore), authentication, device features (location, notifications, biometrics), and third-party integrations (Stripe, linking, sharing).
Expo SDK
Core Functionality
Expo SDK provides a comprehensive toolkit for building React Native applications with file-based routing through Expo Router. This skill covers navigation patterns, media handling, data persistence, authentication, device hardware integration, and third-party service integration.
When to Use
This skill should be used when users need to work with Expo SDK and Expo Router for building React Native applications. It provides comprehensive guidance on navigation patterns, media handling (camera, image, video, audio), data storage (SQLite, filesystem, SecureStore), authentication, device features (location, notifications, biometrics), and third-party integrations (Stripe, linking, sharing).
Module Overview
Navigation Module
- Functionality: Comprehensive file-based routing system with support for stack, tabs, drawer, and modal navigators. Includes dynamic routes, protected routes, redirects, and deep linking capabilities.
- Key APIs:
useRouter,Link,Stack,Tabs,Drawer,Modal,Redirect,useLocalSearchParams,router.navigate,router.push,router.back,router.replace,router.setParams - Detailed documentation:
references/navigation.mdx,references/stack.mdx,references/tabs.mdx,references/drawer.mdx,references/modals.mdx,references/redirects.mdx
Authentication Module
- Functionality: Client-side authentication patterns using React Context, protected routes, session management, and SecureStore integration for secure credential storage.
- Key APIs:
Stack.Protected,useSession,SessionProvider,SecureStore.setItemAsync,SecureStore.getItemAsync,Redirect - Detailed documentation:
references/authentication.mdx,references/authentication-rewrites.mdx,references/protected.mdx
Media Module
- Functionality: Camera access and preview, image loading with caching, image manipulation, media library access, video playback, audio recording and playback, and Live Photo support.
- Key APIs:
CameraView,useCameraPermissions,Image,useVideoPlayer,VideoView,useAudioPlayer,useAudioRecorder,ImageManipulator,MediaLibrary.getAssetsAsync,launchImageLibraryAsync - Detailed documentation:
references/camera.mdx,references/image.mdx,references/video.mdx,references/audio.mdx,references/imagepicker.mdx,references/imagemanipulator.mdx,references/media-library.mdx
Storage Module
- Functionality: SQLite database operations with async/await patterns, filesystem access for file operations, and encrypted key-value storage for sensitive data.
- Key APIs:
SQLite.openDatabaseAsync,execAsync,runAsync,getFirstAsync,getAllAsync,prepareAsync,withTransactionAsync,FileSystem.downloadFileAsync,File,Directory,SecureStore.setItemAsync,SecureStore.getItemAsync - Detailed documentation:
references/sqlite.mdx,references/filesystem.mdx,references/securestore.mdx
Device Module
- Functionality: Geolocation tracking with background support, push and local notifications, biometric authentication (Face ID, Touch ID, fingerprint), and background task management.
- Key APIs:
Location.requestForegroundPermissionsAsync,Location.getCurrentPositionAsync,Location.watchPositionAsync,Notifications.scheduleNotificationAsync,Notifications.addNotificationReceivedListener,LocalAuthentication.authenticateAsync - Detailed documentation:
references/location.mdx,references/notifications.mdx,references/local-authentication.mdx,references/task-manager.mdx
Integration Module
- Functionality: Deep linking and universal links, file sharing between apps, Stripe payment integration, Apple Handoff for cross-device continuity, clipboard access, and native intent handling.
- Key APIs:
Linking.openURL,Linking.createURL,Sharing.shareAsync,initStripe,PaymentSheet,Clipboard.setStringAsync,Clipboard.getStringAsync - Detailed documentation:
references/linking.mdx,references/sharing.mdx,references/stripe.mdx,references/apple-handoff.mdx,references/clipboard.mdx
Workflow
Navigation and Routing
- Define file-based routes using
app/directory structure with special notation (square brackets for dynamic routes, parentheses for route groups, underscore for layouts) - Use
useRouter()for imperative navigation (router.push(),router.back(),router.replace()) - Use
<Link>component for declarative navigation - Implement layouts with
_layout.tsxfiles to configure navigators (Stack, Tabs, Drawer) - Reference detailed navigation patterns in
references/navigation.mdxandreferences/notation.mdx
Authentication Implementation
- Create authentication context with
useSessionhook for session state management - Use
Stack.ProtectedorTabs.Protectedfor protected route groups - Store credentials securely using
SecureStoreAPI - Implement redirects for unauthenticated users using
<Redirect>component - Reference complete authentication guides in
references/authentication.mdx
Media Handling
- Request permissions using
useCameraPermissionsorMediaLibrary.usePermissions - Use
<CameraView>component for camera functionality - Load images with
<Image>component for optimized caching and performance - Implement video playback with
useVideoPlayerhook and<VideoView>component - Reference media APIs in
references/camera.mdx,references/image.mdx,references/video.mdx
Data Persistence
- For structured data: Use
SQLite.openDatabaseAsync()with async/await for database operations - For secure credentials: Use
SecureStore.setItemAsync()andgetItemAsync() - For file operations: Use
FileSystemAPI for downloads, uploads, and directory management - Reference storage solutions in
references/sqlite.mdx,references/securestore.mdx,references/filesystem.mdx
Device Features
- Location: Request foreground/background permissions, then use
Location.getCurrentPositionAsync()orLocation.watchPositionAsync() - Notifications: Configure with
Notifications.setNotificationHandler(), then schedule withNotifications.scheduleNotificationAsync() - Biometrics: Use
LocalAuthentication.authenticateAsync()for fingerprint/Face ID authentication - Reference device-specific guides in
references/location.mdx,references/notifications.mdx,references/local-authentication.mdx
Third-Party Integration
- Deep linking: Configure linking in
app.config.js, useLinking.openURL()or<Link>component - Stripe payments: Initialize with
initStripe(), usePaymentSheetfor payment flow - Sharing: Use
Sharing.shareAsync()to share files and content - Reference integration guides in
references/stripe.mdx,references/linking.mdx,references/sharing.mdx
Common Patterns
Dynamic Routes
Use square brackets in file names (e.g., [id].tsx) and access parameters with useLocalSearchParams() hook.
Protected Routes
Wrap authenticated screens with <Stack.Protected> or use client-side redirects based on session context.
Modal Presentation
Create files inside ../modal/ directory or use <Modal> from React Native for custom presentations.
Background Tasks
Define tasks with TaskManager.defineTask() and configure location updates or notifications in background.
Resource References
Navigation & Routing
- File-based routing basics:
references/navigation.mdx - Route notation reference:
references/notation.mdx - Stack navigator:
references/stack.mdx - Tabs navigator:
references/tabs.mdx - Modals:
references/modals.mdx - Redirects:
references/redirects.mdx
Authentication
- Protected routes (SDK 53+):
references/authentication.mdx - Authentication patterns (SDK 52):
references/authentication-rewrites.mdx - Protected components:
references/protected.mdx
Media Handling
- Camera:
references/camera.mdx - Image loading:
references/image.mdx - Video playback:
references/video.mdx - Audio:
references/audio.mdx - Image picker:
references/imagepicker.mdx - Media library:
references/media-library.mdx
Storage & Data
- SQLite database:
references/sqlite.mdx - File system:
references/filesystem.mdx - Secure storage:
references/securestore.mdx
Device Features
- Location services:
references/location.mdx - Notifications:
references/notifications.mdx - Biometric auth:
references/local-authentication.mdx - Background tasks:
references/task-manager.mdx
Integration
- Stripe payments:
references/stripe.mdx - Deep linking:
references/linking.mdx - Sharing:
references/sharing.mdx - Apple Handoff:
references/apple-handoff.mdx - Clipboard:
references/clipboard.mdx
For complete API specifications, advanced configurations, and platform-specific considerations, refer to the detailed documentation in the references/ directory.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.