{"id":22825593,"url":"https://github.com/flamelink/flamelink-js-sdk","last_synced_at":"2025-04-23T08:14:09.883Z","repository":{"id":34304189,"uuid":"167006948","full_name":"flamelink/flamelink-js-sdk","owner":"flamelink","description":"🦊 Official Flamelink JavaScript SDK for both the Firebase Realtime database and Cloud Firestore","archived":false,"fork":false,"pushed_at":"2023-01-03T17:02:46.000Z","size":33176,"stargazers_count":42,"open_issues_count":20,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T08:14:01.382Z","etag":null,"topics":["browser","firebase","flamelink","javascript","nodejs","sdk"],"latest_commit_sha":null,"homepage":"https://flamelink.github.io/flamelink-js-sdk","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/flamelink.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-22T14:20:59.000Z","updated_at":"2024-11-04T01:22:20.000Z","dependencies_parsed_at":"2023-01-15T06:09:22.105Z","dependency_job_id":null,"html_url":"https://github.com/flamelink/flamelink-js-sdk","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamelink%2Fflamelink-js-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamelink%2Fflamelink-js-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamelink%2Fflamelink-js-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamelink%2Fflamelink-js-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flamelink","download_url":"https://codeload.github.com/flamelink/flamelink-js-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250395284,"owners_count":21423400,"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":["browser","firebase","flamelink","javascript","nodejs","sdk"],"created_at":"2024-12-12T17:11:30.489Z","updated_at":"2025-04-23T08:14:09.865Z","avatar_url":"https://github.com/flamelink.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TITLE/ --\u003e\n\n\u003ch1\u003eFlamelink JavaScript SDK\u003c/h1\u003e\n\n\u003c!-- /TITLE --\u003e\n\n\u003c!-- BADGES/ --\u003e\n\n\u003cspan class=\"badge-badge\"\u003e\u003ca href=\"https://lernajs.io/\" title=\"Maintained by Lerna\"\u003e\u003cimg src=\"https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg\" alt=\"Lerna\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-badge\"\u003e\u003ca href=\"https://conventionalcommits.org\" title=\"Conventional Commits\"\u003e\u003cimg src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\" alt=\"Conventional Commits\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmversion\"\u003e\u003ca href=\"https://npmjs.org/package/flamelink\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/flamelink.svg\" alt=\"NPM version\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmdownloads\"\u003e\u003ca href=\"https://npmjs.org/package/flamelink\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/flamelink.svg\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-badge\"\u003e\u003ca href=\"https://circleci.com/gh/flamelink/flamelink-js-sdk.svg?style=svg\u0026circle-token=dd64f26e069cdd05f52cf304304e0d97ee967b07\" title=\"CircleCI\"\u003e\u003cimg src=\"https://circleci.com/gh/flamelink/flamelink-js-sdk.svg?style=svg\u0026circle-token=dd64f26e069cdd05f52cf304304e0d97ee967b07\" alt=\"CircleCI\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-badge\"\u003e\u003ca href=\"https://www.jsdelivr.com/package/npm/flamelink\" title=\"jsDelivr\"\u003e\u003cimg src=\"https://data.jsdelivr.com/v1/package/npm/flamelink/badge\" alt=\"jsDelivr\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\n\u003c!-- /BADGES --\u003e\n\n![logo](https://raw.githubusercontent.com/flamelink/flamelink/master/docs/_assets/icon.svg?sanitize=true)\n\n\u003e Easily integrate with your Flamelink CMS.\n\n**Official Flamelink JavaScript SDK for both the \u003cins\u003eFirebase Realtime Database\u003c/ins\u003e and \u003cins\u003eCloud Firestore\u003c/ins\u003e**\n\n\u003c!-- DESCRIPTION/ --\u003e\n\nThis SDK is intended for use in a browser or Node.js environment.\n\nIf you are unfamiliar with Flamelink, please visit our [flamelink.io](https://www.flamelink.io/) website for more info on features, pricing and more.\n\n\u003c!-- /DESCRIPTION --\u003e\n\n## Prerequisites\n\nIt goes without saying that you will need to have a [Flamelink](https://www.flamelink.io) project for this SDK to be of any use to you.\n\nApart from the Flamelink project, the only real hard dependency is either the [Firebase JavaScript SDK](https://www.npmjs.com/package/firebase) or [Firebase Admin SDK](https://firebase.google.com/docs/admin/setup), depending on whether you use Flamelink from a browser or server environment. Take a look at the installation instructions on their README files, but in short, just make sure you add `firebase` and/or `firebase-admin` as a dependency to your project.\n\n\u003e When running a universal app, you might need to switch been the client and admin SDK depending on where in the stack the code is running.\n\nOnce you have `firebase` installed, you can install `flamelink` using any of the following options (we recommend `npm` or `yarn`):\n\n## Installation\n\nInstall with `npm`\n\n```bash\nnpm install --save flamelink@next\n```\n\nor with `yarn`\n\n```bash\nyarn add flamelink@next\n```\n\nor with a `\u003cscript\u003e` tag hosted from any of these CDN's\n\n### jsDelivr\n\nAdd the following script tag to the `\u003cbody\u003e` of your index.html file:\n\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/flamelink@next/flamelink.js\"\u003e\u003c/script\u003e\n```\n\nThis will always load the latest version of this SDK for you. If you want to load a specific version, you can specify the version number as well (1.0.0-rc.2 in the example):\n\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/flamelink@1.0.0-rc.2/flamelink.js\"\u003e\u003c/script\u003e\n```\n\n\u003e See the [jsDelivr website](https://www.jsdelivr.com/?query=flamelink) for more options\n\n### unpkg\n\nAdd the following script tag to the `\u003cbody\u003e` of your index.html file:\n\n```html\n\u003cscript src=\"//unpkg.com/flamelink@next/flamelink.js\"\u003e\u003c/script\u003e\n```\n\nThis will always load the latest version of this SDK for you. If you want to load a specific version, you can specify the version number as well (1.0.0-rc.2 in the example):\n\n```html\n\u003cscript src=\"//unpkg.com/flamelink@1.0.0-rc.2/flamelink.js\"\u003e\u003c/script\u003e\n```\n\n\u003e See the [unpkg website](https://unpkg.com) for more options\n\n## Usage\n\n### Importing/Adding the dependencies\n\nFirst ensure that you load the `firebase` SDK and then the main `flamelink` app package along with any of the modules you want to you in your project.\n\n\u003e The examples below shows you how to quickly get started. Take a look at the [Advanced Installation](https://flamelink.github.io/flamelink-js-sdk/#/getting-started?id=advanced-installation) instructions to import only what you need.\n\nIn a CommonJS environment:\n\n```javascript\nvar flamelink = require('flamelink')\n```\n\nor using ES Modules or TypeScript:\n\n```javascript\nimport flamelink from 'flamelink'\n```\n\n\u003e **Note:** You might need to enable the `esModuleInterop` option in either your `tsconfig.json` file or provided as a CLI flag when using TypeScript.\n\n### Creating your Flamelink app instance\n\nCreate your `flamelink` app instance by passing in an existing `firebaseApp` instance along with any other `flamelink` config options:\n\n```javascript\nimport * as firebase from 'firebase'\nimport flamelink from 'flamelink'\n\nconst firebaseConfig = {\n  apiKey: '\u003cyour-api-key\u003e',\n  authDomain: '\u003cyour-auth-domain\u003e',\n  databaseURL: '\u003cyour-database-url\u003e',\n  projectId: '\u003cyour-project-id\u003e',\n  storageBucket: '\u003cyour-storage-bucket-code\u003e',\n  messagingSenderId: '\u003cyour-messenger-id\u003e',\n}\n\nconst firebaseApp = firebase.initializeApp(firebaseConfig)\n\nconst app = flamelink({\n  firebaseApp, // required\n  dbType: 'rtdb', // can be either 'rtdb' or 'cf' for Realtime DB or Cloud Firestore\n  env: 'production', // optional, default shown\n  locale: 'en-US', // optional, default shown\n  precache: true, // optional, default shown. Currently it only precaches \"schemas\" for better performance\n})\n```\n\n\u003e **Tip:** Go to your [Firebase console](https://console.firebase.google.com/) for more info regarding the Firebase app options.\n\nWhen using the `firebase-admin` SDK on server-side, it is the same, you only pass in the Firebase admin app instance instead:\n\n```javascript\nconst admin = require('firebase-admin')\nconst flamelink = require('flamelink')\nconst serviceAccount = require('path/to/serviceAccountKey.json')\n\nconst firebaseConfig = {\n  credential: admin.credential.cert(serviceAccount),\n  databaseURL: '\u003cyour-database-url\u003e',\n  storageBucket: '\u003cyour-storage-bucket-code\u003e', // required if you want to use any Storage Bucket functionality\n}\n\nconst firebaseApp = admin.initializeApp(config)\n\nconst app = flamelink({\n  firebaseApp, // required\n  // same options as above\n})\n```\n\n\u003e You can use any of the [different ways to create the admin firebaseApp instance](https://firebase.google.com/docs/admin/setup).\n\n### Using your flamelink app\n\nOnce you have an instance of the [`flamelink` app](https://app.flamelink.io), you can start using it to interact with your data stored in either your Firebase Real-time Database or Cloud Firestore. Suppose you want to retrieve all your `products` created under the \"Content\" section in `flamelink`.\n\n```javascript\nconst products = await app.content.get({ schemaKey: 'products' })\nconsole.log('All of your products:', products)\n```\n\nAs easy as that. Read our [docs](https://flamelink.github.io/flamelink-js-sdk) for more specifics.\n\n\u003e 🔥🔥🔥 **Flame on!!** 🔥🔥🔥\n\n\u003c!-- HISTORY/ --\u003e\n\n\u003ch2\u003eHistory\u003c/h2\u003e\n\n\u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/blob/master/HISTORY.md#files\"\u003eDiscover the release history by heading on over to the \u003ccode\u003eHISTORY.md\u003c/code\u003e file.\u003c/a\u003e\n\n\u003c!-- /HISTORY --\u003e\n\n\u003c!-- BACKERS/ --\u003e\n\n\u003ch2\u003eBackers\u003c/h2\u003e\n\n\u003ch3\u003eMaintainers\u003c/h3\u003e\n\nThese amazing people are maintaining this project:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://jperasmus.me\"\u003eJP Erasmus\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=jperasmus\" title=\"View the GitHub contributions of JP Erasmus on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dewetvdm\"\u003eDe Wet van der Merwe\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=dewetvdm\" title=\"View the GitHub contributions of De Wet van der Merwe on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003ch3\u003eSponsors\u003c/h3\u003e\n\nNo sponsors yet! Will you be the first?\n\n\u003ch3\u003eContributors\u003c/h3\u003e\n\nThese amazing people have contributed code to this project:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://jperasmus.me\"\u003eJP Erasmus\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=jperasmus\" title=\"View the GitHub contributions of JP Erasmus on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dewetvdm\"\u003eDe Wet van der Merwe\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=dewetvdm\" title=\"View the GitHub contributions of De Wet van der Merwe on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://sinanbolel.com\"\u003eSinan Bolel\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=sbolel\" title=\"View the GitHub contributions of Sinan Bolel on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://github.com/apps/dependabot\"\u003edependabot[bot]\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=dependabot[bot]\" title=\"View the GitHub contributions of dependabot[bot] on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"flamelink.io\"\u003eDe Wet van der Merwe\u003c/a\u003e — \u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/commits?author=gitdubz\" title=\"View the GitHub contributions of De Wet van der Merwe on repository flamelink/flamelink-js-sdk\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003ca href=\"https://github.com/flamelink/flamelink-js-sdk/blob/master/CONTRIBUTING.md#files\"\u003eDiscover how you can contribute by heading on over to the \u003ccode\u003eCONTRIBUTING.md\u003c/code\u003e file.\u003c/a\u003e\n\n\u003c!-- /BACKERS --\u003e\n\n\u003c!-- LICENSE/ --\u003e\n\n\u003ch2\u003eLicense\u003c/h2\u003e\n\nUnless stated otherwise all works are:\n\n\u003cul\u003e\u003cli\u003eCopyright \u0026copy; \u003ca href=\"http://flamelink.io\"\u003eFlamelink\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\nand licensed under:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://spdx.org/licenses/MIT.html\"\u003eMIT License\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003c!-- /LICENSE --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamelink%2Fflamelink-js-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflamelink%2Fflamelink-js-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamelink%2Fflamelink-js-sdk/lists"}