Skip to content

React Native

Use Pulsabase in React Native with AsyncStorage-backed sessions.

Terminal window
npm install @pulsabase/sdk @pulsabase/react-native @react-native-async-storage/async-storage
import { PulsaClient } from '@pulsabase/sdk';
import { AsyncStorageAdapter } from '@pulsabase/react-native';
const pulsabase = new PulsaClient({
url: 'https://api.yourproject.pulsabase.io',
clientKey: 'your-public-client-key',
auth: {
storage: new AsyncStorageAdapter(),
},
});

The API is identical to the TypeScript SDK. The only difference is the storage adapter for persisting session tokens.

// All standard SDK methods work
const users = await pb.from('users').find();
await pb.auth.signInWithPassword('user@example.com', 'securePassword');
// Realtime works over WebSocket
pb.from('messages').subscribe('INSERT', (msg) => {
// Update state
});

You can use the same @pulsabase/react hooks:

Terminal window
npm install @pulsabase/react
import { useQuery, useAuth } from '@pulsabase/react';
// Same API as web React