Wondering what’s next for npm?Check out our public roadmap! »


    0.0.21 • Public • Published

    Moralis Build Serverless web3 apps

    Moralis SDK for JavaScript

    A library that gives you access to the powerful Moralis Server backend from your JavaScript app. Create Server Here

    For more information on Moralis and its features, see the website, the JavaScript guide, the Cloud Code guide or Web3 Reference.

    Getting Started

    The easiest way to integrate the Moralis SDK into your JavaScript project is through the npm module. However, if you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/moralis/dist/moralis.js, and the minified production version is at https://unpkg.com/moralis/dist/moralis.min.js.

    Using Moralis on Different Platforms

    The JavaScript ecosystem is wide and incorporates a large number of platforms and execution environments. To handle this, the Moralis npm module contains special versions of the SDK tailored to use in Node.js and React Native environments. Not all features make sense in all environments, so using the appropriate package will ensure that items like local storage, user sessions, and HTTP requests use appropriate dependencies. For server side rendered applications, you may set the SERVER_RENDERING variable to prevent warnings at runtime.

    To use the npm modules for a browser based application, include it as you normally would:

    const Moralis = require('moralis');
    // ES6 Minimized
    import Moralis from 'moralis/dist/moralis.min.js';

    For server-side applications or Node.js command line tools, include 'moralis/node':

    // In a node.js environment
    const Moralis = require('moralis/node');

    For React Native applications, include 'moralis/react-native.js':

    // In a React Native application
    const Moralis = require('moralis/react-native.js');
    // On React Native >= 0.50 and Moralis >= 1.11.0, set the Async
    const AsyncStorage = require('react-native').AsyncStorage;

    For WeChat miniprogram, include 'moralis/weapp':

    // In a WeChat miniprogram
    const Moralis = require('moralis/weapp');

    If you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/moralis/dist/moralis.weapp.js, and the minified production version is at https://unpkg.com/moralis/dist/moralis.weapp.min.js.

    For TypeScript applications, install '@types/moralis':

    $ npm install @types/moralis

    Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to [@types/moralis][types-moralis]

    3rd Party Authentications

    Moralis Server supports many [3rd Party Authenications][3rd-party-auth]. It is possible to [linkWith][link-with] any 3rd Party Authentication by creating a [custom authentication module][custom-auth-module].


    npm i moralis

    DownloadsWeekly Downloads






    Unpacked Size

    4.66 MB

    Total Files


    Last publish


    • avatar
    • avatar