{"id":24189297,"url":"https://github.com/baqend/js-sdk","last_synced_at":"2025-05-12T13:31:21.076Z","repository":{"id":27226585,"uuid":"30697842","full_name":"Baqend/js-sdk","owner":"Baqend","description":"Baqend JavaScript SDK and CLI for High-Performance Websites","archived":false,"fork":false,"pushed_at":"2024-09-12T13:45:22.000Z","size":25556,"stargazers_count":26,"open_issues_count":4,"forks_count":6,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-09T16:02:27.011Z","etag":null,"topics":["baas","backend-as-a-service","baqend","javascript","sdk","serverless"],"latest_commit_sha":null,"homepage":"https://www.baqend.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Baqend.png","metadata":{"files":{"readme":"README-ACTIAN.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-12T10:38:13.000Z","updated_at":"2024-08-27T11:51:41.000Z","dependencies_parsed_at":"2023-12-20T13:01:53.134Z","dependency_job_id":"e4aec537-9bb4-4510-b397-8355af98f7ce","html_url":"https://github.com/Baqend/js-sdk","commit_stats":{"total_commits":1306,"total_committers":31,"mean_commits":42.12903225806452,"dds":0.5903522205206738,"last_synced_commit":"ac47f103db7302f7df4cafc35590d20667e352f1"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baqend%2Fjs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baqend%2Fjs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baqend%2Fjs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baqend%2Fjs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Baqend","download_url":"https://codeload.github.com/Baqend/js-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253747775,"owners_count":21957802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baas","backend-as-a-service","baqend","javascript","sdk","serverless"],"created_at":"2025-01-13T14:24:24.200Z","updated_at":"2025-05-12T13:31:21.016Z","avatar_url":"https://github.com/Baqend.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Actian BaaS JavaScript SDK\n=====================\nActian BaaS JavaScript SDK and CLI for High-Performance Websites\n\n* [Docs](https://www.baqend.com/guide/)\n* [CLI help](https://www.baqend.com/guide/topics/cli/)\n* [Dashboard](https://dashboard.baqend.com/register/)\n\nCLI\n-----\nActian BaaS provides a CLI to easily manage your app. Install it by typing `npm install -g baqend`.\nAfterwards you can use the `baqend` command in your terminal.\n\nSetup\n-----\n\nTo use the Actian BaaS SDK, just include the [baqend.js](//www.baqend.com/js-sdk/latest/baqend.es5.js) or \n[baqend.min.js](//www.baqend.com/js-sdk/latest/baqend.es5.js) from the dist folder\nat the bottom of your body.\u003cbr\u003e\nAlternatively you can install the Actian BaaS SDK with npm. Just type `npm install baqend`\u003cbr\u003e \nOr [download the latest release](https://github.com/Baqend/js-sdk/releases/latest) directly from GitHub.\n\n```html\n\u003c!-- for legacy browsers --\u003e\n\u003cscript nomodule type=\"text/javascript\" src=\"dist/baqend.es5.min.js\"\u003e\u003c/script\u003e\n\u003c!-- for browsers with module support --\u003e\n\u003cscript type=\"module\" src=\"dist/baqend.es2015.min.js\"\u003e\u003c/script\u003e\n```\n\nYou can use [unpkg.com](https://unpkg.com/) to directly load the dependency into your browser\n```html\n\u003c!-- for legacy browsers --\u003e\n\u003cscript nomodule type=\"text/javascript\" src=\"https://unpkg.com/baqend@3/dist/baqend.es5.min.js\"\u003e\u003c/script\u003e\n\u003c!-- for browsers with module support --\u003e\n\u003cscript type=\"module\" src=\"https://unpkg.com/baqend@3/dist/baqend.es2015.min.js\"\u003e\u003c/script\u003e\n```\n\nThe Actian BaaS SDK provides a global `Baqend` variable by default.\n\nInitialize\n----------\n\nBefore you can actually use the Actian BaaS SDK, you must link the Actian BaaS SDK to your Baqend Account.\nJust call `Baqend.db.connect(\u003cyour Baqend APP\u003e)` after including the Actian BaaS SDK.\n\nThe Actian BaaS SDK connects to your Actian BaaS and initialize the SDK. If the connection was successfully established\nthe ready callback will be called, and the `db` can be used to load, query and save objects.\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { db } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.min.js';\n\n// connects to your Baqend Accounts example app\ndb.connect('example');\n\n// Or pass false as a second parameter for an unencrypted connection (not recommended)\ndb.connect('example', false);\n\n// For custom deployments i.e. the community edition use:\ndb.connect('https://baqend.example.com/v1');\n\n// waits while the SDK connects to your Baqend\nawait db.ready();\n\n// work with your Baqend instance\ndb.User.find()\n\n\u003c/script\u003e\n```\n\nUpgrading from 2.x\n-----\n\nThere are some steps required to upgrade to the v3 version if you have previously used our v2 release.\n \nWe recommend changing your current imports to use the new \n[ES2015 module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) structure \nof the SDK.\nTherefore, you should migrate your code to use the new ES2015 module imports: \n```html\n\u003cscript type=\"module\"\u003e\nimport { db, util } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.min.js';\n\nawait db.connect('\u003cyour-app\u003e');\nconst result = await db.MyClass.find().resultList();\nresult.forEach(object =\u003e {\n    ...\n})\n```\n\nYou may change some import path. With node 14+ you can't require any specific subpath directly anymore.\nAccessing subpackages of the SDK can now be made by importing the submodule and use the modules from it:\n```js\nimport { util, metamodel } from 'baqend';\n\n// generates a random uuid\nutil.uuid()\n```\n\nTo enable better tree shaking support we have moved some classes from the util submodule to the new intersection \nsubmodule. The classes can still be accessed through the util module, but a deprecation warning will be logged. \nYou should change the imports from util to intersection to fix the warning.\n\n```js\nimport { util, intersection } from 'baqend';\n\nutil.Permission() // access via util is deprecated\nintersection.Permission() // change it by improting from the new submodule\n```\n \nIf you have previously relied on the global DB variable, you must expose the global DB variable manually now.\nThis will provide you with all the exports which were available in the 2.x release of the SDK:\n```js\nwindow.DB = Baqend.db;\n\nawait DB.connect('\u003cyour-app\u003e');\nconst result = await DB.MyClass.find().resultList();\n...\n```\n\nWe have dropped the cryptojs dependency and have replaced it with a native implementation of node.js / browser APIs.\nAs a direct result, we have to change the signature of `file.url -\u003e string` to an asynchronous version of it by providing     \n`file.createURL() -\u003e Promise\u003cstring\u003e` as a new method. Accessing the old property `file.url` will throw an exception.\n\nAll previously shipped shims are removed from our bundles to make the overall library size smaller. \nIf you still need to support old Browsers e.g. IE, ensure that you will bundle a `Promise` shim to let the SDK work \nproperly.   \n\nWe have improved the typescript support by providing better typings. You may experience some new typescript \nerrors since the typings are more precise in many cases.\n\nActian BaaS Real-Time SDK\n--------------------\nIf you want to use real-time queries, you must include [Rx.js](https://github.com/ReactiveX/rxjs) in your project \nas well. The realtime components are now core part of v3 release of the SDK and no alternative module must be \nused. \n\nThe Rx.js module will be loaded as an optional peer dependency from the global Rx variable \nor will be required via. `require('rxjs')` call.\nIf rxjs can't be loaded the realtime components of the SDK will throw an exception.\n\nYou can use the unpkg CDN to get all dependencies:\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/rxjs/bundles/rxjs.umd.min.js\"\u003e\u003c/script\u003e\n\u003c!-- include the SDK after rxjs --\u003e\n\u003cscript type=\"module\"\u003e\nimport { db } from 'https://unpkg.com/baqend@3/dist/baqend.es2015.js';\n\nawait db.connect('\u003cyour-app\u003e');\nconst observable = db.MyClass.find().resultStream();\nobservable.subscribe((result) =\u003e {\n    result.forEach(object =\u003e {\n        ...\n    })\n})\n\u003c/script\u003e\n```\n\n\nUsage in Node.js\n----------------\n\nThe Actian BaaS SDK can also be used in Node.js. Just do an `npm install baqend` and use \n`require('baqend')` for old node environments or `import { db } from 'baqend'` in your code.\n\nUp to Node.js v12\n\n```javascript\nconst { db } = require('baqend');\n\n// connects to your Baqend Accounts example app\ndb.connect('example');\n\n// waits while the SDK connects to your Baqend\ndb.ready(function() {\n    // work with your Baqend\n    db.User.find()\n        ...\n});\n```\n\nNode.js v13+\n\n```javascript\nimport { db } from 'baqend';\n\n// connects to your Baqend Accounts example app \n// and waits while the SDK connects to your Baqend\nawait db.connect('example');\n\n// work with your Baqend\nawait db.User.find()\n   ...\n```\n\nNote: The Actian BaaS Real-Time SDK can be used by just installing Rx.js as well `npm install rxjs`\n\nLicense\n-------\n\nThis Actian BaaS SDK is published under the very permissive [MIT license](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaqend%2Fjs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaqend%2Fjs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaqend%2Fjs-sdk/lists"}