bmob-database-javascript

Solid

Use when implementing Bmob NoSQL database CRUD with the cross-platform hydrogen-js-sdk (3.0+ supports both Secret Key + API 安全码 and Application ID + REST API Key init) — ONE SDK file (Bmob-x.x.x.min.js) covers ALL of: browser, Node.js, WeChat Mini Program, Alipay / ByteDance / QQ / Baidu Mini Programs, Quick App 快应用, Cocos Creator JS, Electron, Tauri, hybrid apps, and any ES6 framework (Vue2 / Vue3 / React / Next.js / Vite / Nuxt). Triggers: Bmob.initialize, Bmob.Query, Bmob.User, Bmob.Pointer, Bmob.GeoPoint, Bmob.Relation, hydrogen-js-sdk, npm install hydrogen-js-sdk, import Bmob from 'hydrogen-js-sdk', 微信小程序 Bmob, Cocos Creator Bmob, query.find, query.set, query.save, query.destroy, query.equalTo. NOT for Android native (use bmob-database-android), iOS native (use bmob-database-ios), Flutter / Dart (use bmob-database-flutter), curl / Python / Go / PHP / C# (use bmob-database-restful), or C++ Cocos2d-x (separate skill). If Bmob MCP is configured in the project, call get_project_tables first via bmob-mcp befo

API & Backend 2 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
16
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Bmob Database — JavaScript / 跨端 SDK [hydrogen-js-sdk](https://github.com/bmob/hydrogen-js-sdk) 是 **同一个 SDK 文件 `Bmob-<version>.min.js`** 支持以下所有宿主环境,无平台分支代码: - 浏览器 / 任何 Web 前端(React、Vue 2、Vue 3、Next.js、Nuxt、Vite、Astro、SvelteKit、Solid 等) - Node.js 服务端(必须源码引入) - 微信小程序 / 支付宝 / 字节跳动 / QQ / 百度 小程序 - 快应用 - Cocos Creator JS - Electron / Tauri - 任意混合 App(WebView 内嵌 H5) > **本 skill 只覆盖新版 hydrogen-js-sdk**(`Bmob.Query('X')` Promise 风格,3.0+)。基于 Backbone.js 的旧 `bmob-min.js`(`Bmob.Object.extend("X")` callback 风格)**不要用,也不要回退**。 ## 核心原则 **1. 初始化支持两种方式**(hydrogen-js-sdk **3.0+** 均兼容;按场景二选一,**不要混用**): **方式 A — Secret Key + API 安全码**(**推荐**:浏览器 / 小程序 / 公开客户端,SDK 内部走加密授权): ```js Bmob.initialize("你的Secret Key", "你的API 安全码"); ``` - **Secret Key**:控制台 → 应用 → 设置 → 应用密钥 → **Secret Key**。 - **API 安全码**:控制台 → 应用 → 应用功能设置 → 安全验证 → **API 安全码** 自行设置。 **方式 B — Application ID + REST API Key**(3.0 起正式兼容;适合已有 1.x/2.x 项目迁移、或与服务端 REST 共用同一套 Key): ```js Bmob.initialize("你的Application ID", "你的REST API Key"); ``` - **Application ID** / **REST API Key**:控制台 → 应用 → 设置 → 应用密钥 同一页。 - REST API 请求域名一般为 `https://api.codenow.cn`(见 [`bmob-database-restful`](../bmob-database-restful/SKILL.md))。 > 2.x 时代方式 B 功能受限;**3.0+ 两种初始化等价可用**。公开 bundle 仍优先方式 A(REST API Key 可被抓包)。 **2. 不要 commit 真实密钥进 git;CDN / dist 不要写死 SDK 版本号。** 密钥用环境变量(Vite `import.meta.env.VITE_BMOB_*`、Next.js `process.env.NEXT_PUBLIC_BMOB_*`、小程序构建期注入等)。dist 文件名为 `Bmob-<version>.min.js`,有打包工具时用 `npm install hydrogen-js-sdk`;纯 CDN 浏览器场景用 jsDelivr API 动...

Details

Author
bmob
Repository
bmob/agent-skills
Created
2 months ago
Last Updated
today
Language
Java
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

bmob-database-restful

Use when interacting with Bmob backend cloud over plain HTTP / curl from ANY language that lacks a Bmob SDK — Python (requests/httpx), Go (net/http), PHP (Guzzle), C# (HttpClient), Rust (reqwest), Ruby, Java backend, Bash, Deno, server-side scripting, data migration. Also use when the user explicitly wants curl or the raw REST API URL pattern. API base domain: https://api.codenow.cn (e.g. /1/classes/Token). Triggers: /1/classes/, /1/users, /1/batch, /1/cloudQuery, /1/timestamp, /1/requestSmsCode, X-Bmob-Application-Id, X-Bmob-REST-API-Key, X-Bmob-Safe-Sign, simple auth, encrypted auth, MD5 signature, curl bmob, Bmob REST API, Bmob HTTP. NOT for JavaScript / Node / Web / Mini Program (use bmob-database-javascript), Android (use bmob-database-android), iOS (use bmob-database-ios), or Flutter / Dart (use bmob-database-flutter). If Bmob MCP is configured, generate_code MCP tool can emit ready-to-use curl for 13 operation types — prefer it over hand-writing curl.

2 Updated today
bmob
API & Backend Solid

bmob-database-ios

Use when implementing Bmob NoSQL database CRUD in an iOS native project — both Objective-C and Swift / SwiftUI / UIKit. Triggers: BmobSDK, BmobSDK.xcframework, pod 'BmobSDK', #import <BmobSDK/Bmob.h>, Bmob registerWithAppKey, [Bmob register(withAppKey:)], BmobObject objectWithClassName, BmobQuery queryWithClassName, BmobUser, BmobInstallation, BmobFile, BmobGeoPoint, BmobRelation, saveInBackgroundWithResultBlock, getObjectInBackgroundWithId, findObjectsInBackground, Bridging-Header.h. NOT for cross-platform JavaScript / WeChat Mini Program (use bmob-database-javascript), Android (use bmob-database-android), Flutter / Dart (use bmob-database-flutter), or any other language via REST (use bmob-database-restful). If Bmob MCP is configured, call get_project_tables via bmob-mcp before writing code.

2 Updated today
bmob
API & Backend Solid

bmob-database-flutter

Use when implementing Bmob NoSQL database CRUD in a Flutter / Dart project with the official bmob_plugin package. Triggers: flutter pub add bmob_plugin, package:bmob_plugin/bmob_plugin.dart, Bmob.initialize, BmobQuery, BmobObject, BmobUser, BmobFile, BmobGeoPoint, BmobRelation, BmobAcl, BmobError.convert, blog.save(), query.queryObjects(), query.setInclude, Dart Bmob, Flutter Bmob. NOT for JavaScript / Web / Mini Program (use bmob-database-javascript), Android native without Flutter (use bmob-database-android), iOS native without Flutter (use bmob-database-ios), or server-side HTTP only (use bmob-database-restful). If Bmob MCP is configured, call get_project_tables via bmob-mcp before writing code.

2 Updated today
bmob