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

@harishreddym/baqend

v2.14.1

Published

Baqend JavaScript SDK

Downloads

351

Readme

Baqend JavaScript SDK

Baqend JavaScript SDK and CLI for High-Performance Websites

CLI

Baqend provides a CLI to easily manage your app. Install it by typing npm install -g baqend. Afterwards you can use the baqend command in your terminal.

If you don't already have a Baqend account, type baqend register to create your first app. Now you can open the dashboard of your app with baqend dashboard. To see all the command use baqend help.

Setup

To use the Baqend SDK, just include the baqend.js or baqend.min.js from the dist folder at the bottom of your body. Alternatively you can install the Baqend SDK with npm. Just type npm install --save-dev baqend Or install with bower bower install --save-dev baqend Or download the latest release directly from GitHub.

<!-- for development -->
<script type="text/javascript" src="dist/baqend.js"></script>
<!-- for production -->
<script type="text/javascript" src="dist/baqend.min.js"></script>

You can also include it from our CDN-Provider fastly.

<!-- for development -->
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend.js"></script>
<!-- for production -->
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend.min.js"></script>

The Baqend SDK provides a global DB variable by default.

Baqend Real-Time SDK

If you want to use real-time queries, you have to either use baqend-realtime.js or baqend-realtime.min.js for production. In Addition, you can include Rx.js v5 into your project, for many advanced Observable features. You can use the unpkg CDN:

<script type="text/javascript" src="//unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<!-- include the SDK after rxjs -->
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend-realtime.js"></script>

The SDK is shipped with the core-js Observable shim per default. If you include Rx.js globally, it will be detected and used by the SDK automatically. You can also set the Observable implementation which the SDK will use, by setting the require('baqend/realtime').Observable = Observable afterwards.

Initialize

Before you can actually use the Baqend SDK, you must link the Baqend SDK to your Baqend Account. Just call DB.connect(<your Baqend APP>) after including the Baqend SDK.

The Baqend SDK connects to your Baqend and initialize the SDK. If the connection was successfully established the ready callback will be called and the DB can be used to load, query and save objects.

<script type="text/javascript" src="baqend.js"></script>
<script type="text/javascript">

// connects to your Baqend Accounts example app
DB.connect('example');

// Or pass true as a second parameter for an encrypted connection
DB.connect('example', true);

// For custom deployments i.e. the community edition use:
DB.connect('https://baqend.example.com/v1');

// waits while the SDK connects to your Baqend
DB.ready(function() {
    // work with your Baqend
    DB.User.find()
        ...
});

</script>

Usage in Node.js

The Baqend SDK can also be used in Node.js. Just do an npm install --save baqend and use require('baqend') in your code.

var DB = require('baqend');

// connects to your Baqend Accounts example app
DB.connect('example');

// waits while the SDK connects to your Baqend
DB.ready(function() {
    // work with your Baqend
    DB.User.find()
        ...
});

Note: The Baqend Real-Time SDK can be required with var DB = require('baqend/realtime');, ensure that you only require either the Baqend SDK or the Baqend Real-Time SDK and not both.

Building with browserify

Just install baqend with npm install --save-dev baqend, require('baqend') in your code and build the Baqend SDK + your code with browserify.

var DB = require('baqend');

// connects to your Baqend Accounts example app
DB.connect('example');

// waits while the SDK connects to your Baqend
DB.ready(function() {
    // work with your Baqend
    DB.User.find()
        ...
});

Note: The Baqend Streaming SDK can be required with var DB = require('baqend/realtime');, ensure that you only require either the Baqend SDK or the Baqend Streaming SDK and not both.

Type browserify scripts/main.js > scripts/bundle.js to build your main.js script. For more advanced building steps visit the browserify Documentation.

Building with requirejs

Use the Baqend SDK from the /dist folder or install the SDK via npm npm install --save-dev baqend. Add the Baqend SDK as a dependency of your script and use the required Baqend SDK.

require(["scripts/baqend.js"], function(DB) {
    // connects to your Baqend Account
    DB.connect('example');

    // waits while the SDK connects to your Baqend
    DB.ready(function() {
        // work with your Baqend
        DB.User.find()
            ...
    });
});

For more advanced usage of requirejs visit the requirejs Documentation.

License

This Baqend SDK is published under the very permissive MIT license