2. implement Basic
⚡️ Quickstart
Using the @basictech/expo library with your React Native project
Installation
Install the package via npm:
Define a schema
Define your database schema as a TypeScript constant (e.g., src/schema.ts
):
Provider Integration
Wrap your application’s root with the BasicProvider
:
Note: Ensure your app’s app.json
sets the correct URI scheme under expo.scheme
for authentication callbacks.
Authentication & State Management
Use the useBasic
hook from @basictech/expo
inside your components to access authentication state and database client:
Returned properties:
user
: The authenticated user or null.login()
: Starts the OAuth login flow.signout()
: Logs the user out, clearing all tokens.db
: The main database client.isLoading
: True during authentication state checks.isSignedIn
: Whether a user is authenticated.