npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rembase-react-native

v1.0.0-beta.1

Published

Official React Native SDK for Rembase - a cross platform backend creation tool.

Readme

Rembase React Native SDK

Official React Native SDK for Rembase - a cross-platform backend creation tool. This SDK provides authentication, cloud functions, and other backend services for React Native and Expo applications.

Installation

npm install rembase-react-native

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install react react-native @react-native-async-storage/async-storage

For Expo projects, you can install the async storage package:

npx expo install @react-native-async-storage/async-storage

Quick Start

1. Initialize Rembase

import { rembaseInitSync, CredentialTypes } from 'rembase-react-native';

// Initialize with your app credentials
const rembase = rembaseInitSync('your-app-id', 'your-project-id', 'your-region-code');

2. Authentication

Email/Password Authentication

// Register a new user
await rembase.registerUser('[email protected]', 'password123');

// Login with email/password
const user = await rembase.login(CredentialTypes.email_password('[email protected]', 'password123'));
console.log('Logged in user:', user);

Email OTP Authentication

// Send OTP to email
await rembase.send_email_otp('[email protected]');

// Login with OTP
const user = await rembase.login(CredentialTypes.email_otp('[email protected]', '123456'));

WhatsApp OTP Authentication

// Send OTP to WhatsApp
await rembase.sendWhatsappOTP('+1234567890');

// Login with WhatsApp OTP
const user = await rembase.login(CredentialTypes.whatsapp('+1234567890', '123456'));

Anonymous Authentication

// Login anonymously
const user = await rembase.login(CredentialTypes.anonymous());

3. Cloud Functions

// Call a cloud function
if (rembase.currentUser) {
  const result = await rembase.currentUser.callFunction('myFunction', 'param1', 'param2');
  console.log('Function result:', result);
}

4. User Management

// Check if user is logged in
if (rembase.currentUser) {
  console.log('User ID:', rembase.currentUser.id);
  console.log('User Email:', rembase.currentUser.email);
  
  // Refresh access token
  await rembase.currentUser.refreshAccessToken();
  
  // Logout
  rembase.currentUser.logout();
}

5. Password Management

// Send password reset email
await rembase.sendPasswordResetEmail('[email protected]');

// Reset password with token
await rembase.resetPassword('reset-token', 'newpassword123');

// Reset password instantly (requires authentication)
await rembase.resetPasswordInstantly('oldpassword', 'newpassword123');

6. Logging

// Log custom events
await rembase.log('user_action', true, 'user123', { action: 'click' }, { result: 'success' });

API Reference

Initialization Functions

rembaseInitSync(appId, projectId, regionCode)

Initialize Rembase with your app credentials.

  • appId: Your Rembase app ID
  • projectId: Your Rembase project ID
  • regionCode: Your region code (e.g., 'us', 'eu')

rembaseInitSelfHost(appId, selfHostUrl)

Initialize Rembase with a self-hosted instance.

  • appId: Your Rembase app ID
  • selfHostUrl: Your self-hosted Rembase URL

rembaseInitSyncServer(appId, projectId, regionCode, userToken)

Initialize Rembase with a server-side user token.

  • appId: Your Rembase app ID
  • projectId: Your Rembase project ID
  • regionCode: Your region code
  • userToken: Server-side user token

Credential Types

CredentialTypes.email_password(email, password)

Create email/password credentials.

CredentialTypes.email_otp(email, otp)

Create email OTP credentials.

CredentialTypes.whatsapp(contact, otp)

Create WhatsApp OTP credentials.

CredentialTypes.anonymous()

Create anonymous credentials.

CredentialTypes.jwt(token)

Create JWT token credentials.

CredentialTypes.refreshCredential(id, token)

Create refresh token credentials.

RembaseApp Methods

login(credential)

Authenticate a user with the provided credentials.

registerUser(email, password)

Register a new user with email and password.

send_email_otp(email)

Send OTP to the specified email address.

sendWhatsappOTP(contact)

Send OTP to the specified WhatsApp contact.

resetPassword(token, password)

Reset password using a reset token.

resetPasswordInstantly(oldPassword, newPassword)

Reset password instantly (requires authentication).

sendPasswordResetEmail(email)

Send password reset email.

resendVerificationEmail(email)

Resend verification email.

log(name, success, user_id, request, response, error?, execution_time?)

Log custom events.

RembaseUser Methods

callFunction(functionName, ...args)

Call a cloud function.

refreshAccessToken()

Refresh the user's access token.

logout(redirectPath?, cookieRemoveFunction?)

Logout the current user.

Storage

The SDK uses @react-native-async-storage/async-storage for persistent storage of tokens and configuration. The storage is automatically managed by the SDK.

Error Handling

All methods that can fail will throw errors. Make sure to wrap them in try-catch blocks:

try {
  const user = await rembase.login(CredentialTypes.email_password('[email protected]', 'password'));
  console.log('Login successful:', user);
} catch (error) {
  console.error('Login failed:', error.message);
}

TypeScript Support

This SDK is written in TypeScript and provides full type definitions for all methods and types.

License

MIT

Support

For support and questions, please visit https://rembase.revtrance.com or open an issue on GitHub.