Installation
Learn how to install and set up Resync for your platform.
Choose Your Platform
Select the SDK that matches your technology stack:
- JavaScript SDK - For Node.js applications
- React Native SDK - For iOS and Android mobile apps
JavaScript SDK
Requirements
- Node.js v16 or higher
- npm or yarn package manager
Install via npm
npm install resync-javascript
Install via yarn
yarn add resync-javascript
Initialise
import Resync from 'resync-javascript';
await Resync.init({
key: process.env.RESYNC_API_KEY,
appId: parseInt(process.env.RESYNC_APP_ID),
storage: localStorage,
environment: 'production',
});
React Native SDK
Requirements
- React Native v0.64 or higher
- Node.js v16 or higher
- npm or yarn package manager
Install the SDK
npm install resync-react-native
Or with yarn:
yarn add resync-react-native
Install Peer Dependencies
Resync React Native requires the following peer dependencies:
npm install react-native-svg lucide-react-native @react-native-async-storage/async-storage
Or with yarn:
yarn add react-native-svg lucide-react-native @react-native-async-storage/async-storage
iOS Setup (React Native)
If you're using React Native (not Expo), install iOS pods:
cd ios && pod install && cd ..
Expo Setup
Resync works seamlessly with Expo. No additional configuration needed!
npx expo install resync-react-native react-native-svg @react-native-async-storage/async-storage
Get Your Credentials
Before initializing Resync, you'll need:
- API Key - Your unique API authentication key
- App ID - Your application identifier
Get Credentials from Dashboard
- Log in to Resync Dashboard
- Navigate to Settings → API Keys
- Copy your API key
- Note your Project or App ID (shown in the dashboard URL or Settings)
Initialization
JavaScript Example
import Resync from 'resync-javascript';
// Initialize as early as possible in your app
await Resync.init({
key: process.env.RESYNC_API_KEY,
appId: 7,
callback: () => {
console.log('Resync loaded successfully');
},
storage: someStorage, // Use localStorage for web
environment: 'production', // 'sandbox' or 'production'
});
React Native Example
import Resync from 'resync-react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
// Initialize in App.tsx or index file
Resync.init({
key: process.env.RESYNC_API_KEY,
appId: 7,
callback: () => {
console.log('Resync loaded successfully');
},
storage: AsyncStorage, // Use any compatible storage for React Native
environment: 'production',
});
export default function App() {
return (
// Your app components
);
}
Environment Configuration
Resync supports two environments:
Production
environment: 'production'
- Cache TTL: 6 hours
- Optimized for performance
- Use for live apps
Sandbox
environment: 'sandbox'
- Cache TTL: 0 (no caching)
- Always fetches fresh data
- Use for development and testing
Verify Setup
Test your installation:
// After initialization
const config = Resync.getConfig('TEST_CONFIG');
console.log('Config:', config);
If you see output without errors, you're all set! 🎉
Troubleshooting
"Module not found" error
Make sure you've installed the package:
npm install resync-javascript
# or
npm install resync-react-native
"Storage is required" error
Provide a valid storage object:
- Web: Use
localStorage - React Native: Use
AsyncStorage,MMKVor any compatible storage
Peer dependency warnings (React Native)
Install all required peer dependencies:
npm install react-native-svg lucide-react-native @react-native-async-storage/async-storage
Pods installation failed (iOS)
Try cleaning and reinstalling:
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..
Next Steps
- Initialize and configure Resync →
- Explore JavaScript SDK →
- Explore React Native SDK →
- Build your first form →
Need Help?
- Email hello@getresync.com