Installation
Install the SDK and required dependencies:Quick Start
Initialize the Scalekit client in your app:utils/scalekit.js
Authentication Flow
Login with OAuth
Initiate OAuth login using the device browser:LoginScreen.js
Secure Token Storage
Store tokens securely using Expo SecureStore:utils/tokenStorage.js
App Configuration
Configure Deep Linking
Add the redirect URI scheme to yourapp.json:
app.json
Environment Variables
Create a.env file:
.env
Advanced Features
Login with Organization
Route users to a specific organization:Login with Email Hint
Pre-fill the user’s email:Logout
Clear stored tokens and session:Logout
Token Management
Validate Token
Check if the stored token is valid:Refresh Token
Refresh expired tokens:Making Authenticated Requests
API Client with Token
Create an authenticated API client:utils/apiClient.js
Usage Example
Authentication Context
Create a context provider for app-wide auth state:contexts/AuthContext.js
Use in Components
App.js
Error Handling
Handle authentication errors:Platform-Specific Configuration
iOS Configuration
Add URL scheme inInfo.plist (handled automatically by Expo):
Android Configuration
Add intent filter inAndroidManifest.xml (handled automatically by Expo):