Providers

  • Data Synchronization: Manages connections to peers and the Jazz cloud
  • Local Storage: Persists data locally between app sessions
  • Schema Types: Provides APIs for the AccountSchema
  • Authentication: Connects your authentication system to Jazz

Setting up the Provider

The provider accepts several configuration options:

No content available for tab:
Tip

Sign up for a free API key at dashboard.jazz.tools for higher limits or production use, or use your email address as a temporary key to get started quickly.

Provider Options

Sync Options

The sync property configures how your application connects to the Jazz network:

import { type SyncConfig } from "jazz-tools";

export const syncConfig: SyncConfig = {
  // Connection to Jazz Cloud or your own sync server
  peer: `wss://cloud.jazz.tools/?key=${apiKey}`,

  // When to sync: "always" (default), "never", or "signedUp"
  when: "always",
};
iOS Credential Persistence

On iOS Jazz persists login credentials using Secure Store, which saves them to the Keychain. While this is secure, iOS does not clear the credentials along with other data if a user uninstalls your app.

User accounts are deleted, so if you are using sync: 'never' or sync: 'signedUp', accounts for users who are not 'signed up' will be lost.

If the user later re-installs your app, the credentials for the deleted account remain in the Keychain. Jazz will attempt to use these to sign in and fail, as the account no longer exists.

To avoid this, consider using sync: 'always' for your iOS users, or check the work around here.

See Authentication States for more details on how the when property affects synchronization based on authentication state.

Account Schema

The AccountSchema property defines your application's account structure:

No content available for tab:

Additional Options

The provider accepts these additional options:

  • kvStore
    • ExpoSecureStoreAdapter (default)
  • AccountSchema
    • Account (default)

Authentication

Jazz for Expo includes built-in local persistence using SQLite. Following Expo's best practices, the Expo implementation uses:

  • Database Storage: expo-sqlite - Expo's official SQLite module
  • Key-Value Storage: expo-secure-store - Expo's secure storage system

Local persistence is enabled by default with no additional configuration required. Your data will automatically persist across app restarts.

RNCrypto

Starting from Expo SDK 54, you do not need to follow these steps, RNCrypto will be enabled for you by default. These steps below should be followed only if you are using an older Expo version.

For accelerated crypto operations, you can use the RNCrypto crypto provider. It is the most performant crypto provider available for React Native.

To use it, install the following package:

pnpm add cojson-core-rn

You must keep the versions of cojson-core-rn and jazz-tools the same.

"dependencies": {
  "cojson-core-rn": "x.x.x", # same version as jazz-tools
  "jazz-tools": "x.x.x" # same version as cojson-core-rn
}
Versioning

While you can distribute your own JS code changes OTA, if you update your Jazz version, this will result in changes in the native dependencies, which cannot be distributed over the air and requires a new store submission.

Need Help?

If you have questions about configuring the Jazz Provider for your specific use case, join our Discord community for help.

Was this page helpful?