All Projects → Baqend → js-sdk

Baqend / js-sdk

Licence: MIT license
Baqend JavaScript SDK and CLI for High-Performance Websites

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Smarty
1635 projects

Projects that are alternatives of or similar to js-sdk

parse-hipaa
HIPAA & GDPR compliant ready parse-server with postgres/mongo, parse-hipaa-dashboard. Compatible with ParseCareKit
Stars: ✭ 74 (+196%)
Mutual labels:  baas, backend-as-a-service
Appwrite
Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 🚀
Stars: ✭ 14,592 (+58268%)
Mutual labels:  baas, backend-as-a-service
Space Cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: ✭ 3,323 (+13192%)
Mutual labels:  baas
BaaSDelphiSamples
💾 Code samples for BaaS and PaaS using Delphi
Stars: ✭ 30 (+20%)
Mutual labels:  baas
vbo365-rest
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 44 (+76%)
Mutual labels:  baas
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+652%)
Mutual labels:  baas
sdk-for-php
[READ-ONLY] Official Appwrite PHP SDK 🐘
Stars: ✭ 109 (+336%)
Mutual labels:  baas
Sqler
write APIs using direct SQL queries with no hassle, let's rethink about SQL
Stars: ✭ 1,943 (+7672%)
Mutual labels:  baas
opentab
开源的轻应用后端(Open Tiny App Backend),轻量,高效,易部署。
Stars: ✭ 27 (+8%)
Mutual labels:  baas
playground-for-android
Simple examples that help you get started with Appwrite + Android (=❤️)
Stars: ✭ 48 (+92%)
Mutual labels:  baas
hoodie-notes
A Markdown notebook built with React and Hoodie
Stars: ✭ 17 (-32%)
Mutual labels:  baas
Js Realtime Sdk
LeanCloud Realtime Message JavaScript SDK
Stars: ✭ 193 (+672%)
Mutual labels:  baas
demos-for-svelte
Demos and tutorials for getting started with Appwrite + Svelte
Stars: ✭ 27 (+8%)
Mutual labels:  baas
Xpmjs
微信小程序云端增强 SDK
Stars: ✭ 177 (+608%)
Mutual labels:  baas
sdk-for-kotlin
[READ-ONLY] Official Appwrite Kotlin SDK 💙🧡
Stars: ✭ 41 (+64%)
Mutual labels:  baas
Dv Php Core
Devless is a ready-made back-end for development of web or mobile applications. It is fully open source under the permissive Apache v2 license. This means that you can develop your front end without worrying about neither back-end code or the business risk of a proprietary backend-as-a-service.
Stars: ✭ 171 (+584%)
Mutual labels:  baas
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (-4%)
Mutual labels:  baas
sdk-for-android
[READ-ONLY] Official Appwrite Android SDK 💚 🤖
Stars: ✭ 62 (+148%)
Mutual labels:  baas
playground-for-node
Simple examples that help you get started with Appwrite + Node.js (=❤️)
Stars: ✭ 39 (+56%)
Mutual labels:  baas
ParseCareKit
Securely synchronize any CareKit 2.1+ based app to a Parse Server Cloud. Compatible with parse-hipaa.
Stars: ✭ 28 (+12%)
Mutual labels:  baas

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 baqend
Or download the latest release directly from GitHub.

<!-- for legacy browsers -->
<script nomodule type="text/javascript" src="dist/baqend.es5.min.js"></script>
<!-- for browsers with module support -->
<script type="module" src="dist/baqend.es2015.min.js"></script>

You can use unpkg.com to directly load the dependency into your browser

<!-- for legacy browsers -->
<script nomodule type="text/javascript" src="https://unpkg.com/baqend@3/dist/baqend.es5.min.js"></script>
<!-- for browsers with module support -->
<script type="module" src="https://unpkg.com/baqend@3/dist/baqend.es2015.min.js"></script>

The Baqend SDK provides a global Baqend variable by default.

Initialize

Before you can actually use the Baqend SDK, you must link the Baqend SDK to your Baqend Account. Just call Baqend.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="module">
import { db } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.min.js';

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

// Or pass false as a second parameter for an unencrypted connection (not recommended)
db.connect('example', false);

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

// waits while the SDK connects to your Baqend
await db.ready();

// work with your Baqend instance
db.User.find()

</script>

Upgrading from 2.x

There are may some steps required to upgrade to the v3 version if you have previously used our v2 release.

We recommend changing your current imports to use the new ES2015 module structure of the SDK. Therefore, you should migrate your code to use the new ES2015 module imports:

<script type="module">
import { db, util } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.min.js';

await db.connect('<your-app>');
const result = await db.MyClass.find().resultList();
result.forEach(object => {
    ...
})

You may change some import path. With node 14+ you can't require any specific subpath directly anymore. Accessing subpackages of the SDK can now be made by importing the submodule and use the modules from it:

import { util, metamodel } from 'baqend';

// generates a random uuid
util.uuid()

To enable better tree shaking support we have moved some classes from the util submodule to the new intersection submodule. The classes can still be accessed through the util module, but a deprecation warning will be logged. You should change the imports from util to intersection to fix the warning.

import { util, intersection } from 'baqend';

util.Permission() // access via util is deprecated
intersection.Permission() // change it by improting from the new submodule

If you have previously relied on the global DB variable, you must expose the global DB variable manually now. This will provide you with all the exports which were available in the 2.x release of the SDK:

window.DB = Baqend.db;

await DB.connect('<your-app>');
const result = await DB.MyClass.find().resultList();
...

We have dropped the cryptojs dependency and have replaced it with a native implementation of node.js / browser APIs. As a direct result, we have to change the signature of file.url -> string to an asynchronous version of it by providing
file.createURL() -> Promise<string> as a new method. Accessing the old property file.url will throw an exception.

All previously shipped shims are removed from our bundles to make the overall library size smaller. If you still need to support old Browsers e.g. IE, ensure that you will bundle a Promise shim to let the SDK work properly.

We have improved the typescript support by providing better typings. You may experience some new typescript errors since the typings are more precise in many cases.

Baqend Real-Time SDK

If you want to use real-time queries, you must include Rx.js in your project as well. The realtime components are now core part of v3 release of the SDK and no alternative module must be used.

The Rx.js module will be loaded as a optional peer dependency from the global Rx variable or will be required via. require('rxjs') call. If rxjs can't be loaded the realtime components of the SDK will throw an exception.

You can use the unpkg CDN to get all dependencies:

<script type="text/javascript" src="https://unpkg.com/rxjs/bundles/rxjs.umd.min.js"></script>
<!-- include the SDK after rxjs -->
<script type="module">
import { db } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.js';

await db.connect('<your-app>');
const observable = db.MyClass.find().resultStream();
observable.subscribe((result) => {
    result.forEach(object => {
        ...
    })
})
</script>

Usage in Node.js

The Baqend SDK can also be used in Node.js. Just do an npm install baqend and use require('baqend') for old node environments or import { db } from 'baqend' in your code.

Up to Node.js v12

const { 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()
        ...
});

Node.js v13+

import { db } from 'baqend';

// connects to your Baqend Accounts example app 
// and waits while the SDK connects to your Baqend
await db.connect('example');

// work with your Baqend
await db.User.find()
   ...

Note: The Baqend Real-Time SDK can be used by just installing Rx.js as well npm install rxjs

License

This Baqend SDK is published under the very permissive MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].