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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@capacitor-community/realm

v0.0.3

Published

A native plugin for MongoDB Realm

Downloads

6

Readme

Maintainers

| Maintainer | GitHub | Social | | ------------- | ------------------------------------------- | ------------------------------------------------ | | Priyank Patel | priyankpat | @priyankpat_ |

Installation

Using npm:

npm install @capacitor-community/realm

Using yarn:

yarn add @capacitor-community/realm

Sync native files:

npx cap sync

On iOS, no further steps are needed.

On Android, make changes to the following files:

MainActivity.java:

import com.getcapacitor.community.realm.Realm;

public class MainActivity extends BridgeActivity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(
        savedInstanceState,
        new ArrayList<Class<? extends Plugin>>() {

          {
            // Additional plugins you've installed go here
            // Ex: add(TotallyAwesomePlugin.class);
            add(Realm.class);
          }
        }
      );
  }
}

Supported methods

| Name | Android | iOS | Web | | :------------------------ | :------ | :-- | :-- | | initialize | ✅ | ✅ | ✅ | | signInAnonymously | ✅ | ✅ | ✅ | | logout | ✅ | ✅ | ✅ | | signInWithEmailPassword | ✅ | ✅ | ✅ | | signInWithApiKey | ✅ | ✅ | ✅ | | signInWithJWT | ✅ | ✅ | ✅ | | signInWithGoogle | ✅ | ✅ | ✅ | | signInWithFacebook | ✅ | ✅ | ✅ | | signInWithApple | ✅ | ✅ | ✅ | | registerWithEmailPassword | ✅ | ✅ | ✅ | | confirmEmail | ✅ | ✅ | ✅ | | resetPassword | ✅ | ✅ | ✅ | | sendPasswordResetEmail | ✅ | ✅ | ✅ |

Usage

import { Plugins } from "@capacitor/core";

const { Realm } = Plugins;

/**
 * Platform: Android/iOS/Web
 * Initialize Realm with the correct Application Id
 * @params appId - This ID is unique to this application. It is necessary for connecting any client to Realm.
 * @returns void
 */
Realm.initialize({
  appId: '{{APP_ID}}',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#anonymous
 * The anonymous authentication provider enables users to log in to your application with short-term accounts that store no persistent personal information.
 * @params none
 * @returns void
 */
Realm.signInAnonymously();

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#email-password
 * The Email/Password authentication provider enables users to log in to your application with an email username and a password.
 * @params none
 * @returns void
 */
Realm.signInWithEmailPassword({
    email: '',
    password: '',
});

/**
 * Platform: Android/iOS/Web
 * The API authentication provider enables users to log in to your application with an API key.
 * @params none
 * @returns void
 */
Realm.signInWithApiKey({
    apiKey: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#android-login-custom-jwt
 * The Custom JWT authentication provider enables users to log in to your application with a custom JSON Web Token.
 * @params jwtToken - custom jwt token
 * @returns void
 */
Realm.signInWithJWT({
    jwtToken: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#google-oauth
 * The Google OAuth authentication provider enables users to log in to your application with a custom token provided by Google.
 * @params googleToken - token obtained from google
 * @returns void
 */
Realm.signInWithGoogle({
    googleToken: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#facebook-oauth
 * The Facebook OAuth authentication provider enables users to log in to your application with a custom token provided by Facebook.
 * @params accessToken - token obtained from facebook
 * @returns void
 */
Realm.signInWithFacebook({
    accessToken: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#sign-in-with-apple
 * The Sign-in with Apple authentication provider enables users to log in to your application with a custom token provided by Apple.
 * @params idToken - token obtained from apple
 * @returns void
 */
Realm.signInWithApple({
    idToken: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/authenticate/#log-out
 * The method will log out any user, regardless of the authentication provider.
 * @params none
 * @returns void
 */
Realm.logout();

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/manage-email-password-users/#register-a-new-user-account
 * The method will register a user with email/password authentication provider.
 * @params email - unique email address
 *         password - secure password
 * @returns void
 */
Realm.registerWithEmailPassword({
    email: '',
    password: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/manage-email-password-users/#confirm-a-new-user-s-email-address
 * The method will confirm a user with email/password authentication provider.
 * @params token - parameters in the confirmation link sent in the confirmation email
 *         tokenId - parameters in the confirmation link sent in the confirmation email
 * @returns void
 */
Realm.confirmEmail({
    token: '',
    tokenId: '',
});

/**
 * Platform: Android/iOS/Web
 * https://docs.mongodb.com/realm/android/manage-email-password-users/#reset-a-user-s-password
 * The method will confirm a user with email/password authentication provider.
 * @params token - parameters in the confirmation link sent in the confirmation email
 *         tokenId - parameters in the confirmation link sent in the confirmation email
 *         newPassword - new secure password
 * @returns void
 */
Realm.resetPassword({
    token: '',
    tokenId: '',
    newPassword: '',
});

/**
 * Platform: Android/iOS/Web
 * The method will resend password reset email.
 * @params email - email address of account that requires password reset
 * @returns void
 */
Realm.sendPasswordResetEmail({
    email: '',
});