Skip to content

Instantly share code, notes, and snippets.

@paulweezydesign
Created October 6, 2024 11:58
Show Gist options
  • Save paulweezydesign/77a7c10c5c8d98d13c19dd47602d3b6f to your computer and use it in GitHub Desktop.
Save paulweezydesign/77a7c10c5c8d98d13c19dd47602d3b6f to your computer and use it in GitHub Desktop.
import Realm from 'realm';
import { RealmApp } from './app';
const appConfig = {
id: 'your-app-id',
timeout: 10000,
};
const app = new RealmApp(appConfig);
const realmConfig = {
schema: [
{
name: 'User',
primaryKey: '_id',
properties: {
_id: 'objectId',
email: 'string',
password: 'string',
},
},
],
sync: {
user: app.currentUser,
partitionValue: 'your-partition-value',
},
};
const realm = new Realm(realmConfig);
export { app, realm };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment