Skip to main content

BasicProvider

To enable the features of the Basic SDK, you need to wrap your app in a <BasicProvider> component.
main.tsx

Props

schema

object
required
The Basic schema object containing your project configuration and table definitions. This should be imported from your basic.config.ts file.The project_id is extracted from schema.project_id.

project_id

string
The project ID of your Basic project.
Deprecated: Project ID is now extracted from schema.project_id. This prop is kept for backward compatibility but can be omitted if your schema includes the project_id.

debug

boolean
default:"false"
Enable debug mode for additional logging to the console. Useful during development.

dbMode

'sync' | 'remote'
default:"'sync'"
Determines which database implementation is used:
  • 'sync' (default): Uses IndexedDB + WebSocket for local-first sync. Works offline, provides real-time updates, and useQuery auto-refreshes.
  • 'remote': Uses REST API calls directly to the server. No local storage, requires authentication for all operations, but has no IndexedDB dependencies.
See Database Modes for detailed comparison.

storage

BasicStorage
Custom storage adapter for persisting auth tokens. By default, uses LocalStorageAdapter which stores data in localStorage.Implement the BasicStorage interface to use a custom storage solution (e.g., for React Native with AsyncStorage):

auth

AuthConfig
Custom authentication configuration. Most apps omit this and use defaults.

devToolbar

boolean
default:"false"
When true, shows the lazy-loaded Basic dev toolbar (schema status, useful shortcuts) in environments where it is allowed (for example localhost, NODE_ENV=development, or when debug is enabled on the provider). Export BasicDevToolbar from @basictech/react if you want to place it yourself.

Full Example

main.tsx