bmob-database-javascript

A JavaScript guide for using Bmob, a hosted NoSQL database service, from browsers, servers, and several cross-platform app environments. It uses Bmob's newer hydrogen-js-sdk and covers data, users, files, and related records.

In plain words
What is it for?
Use it to install and initialize the SDK, define and query tables, create, update, or delete records, work with users, files, locations, and relations, and use Bmob from web apps, Node.js, mini programs, or hybrid apps.
Why use it?
It gives one SDK approach across multiple JavaScript environments and explains how to initialize it, protect keys, and avoid mixing newer and older APIs. This reduces errors when building or migrating Bmob-backed applications.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bmob/agent-skills/bmob-database-javascript
Any agent
npx skills add bmob/agent-skills --skill bmob-database-javascript
Clone the repo
git clone --depth 1 https://github.com/bmob/agent-skills

Made for: Claude Code, Codex.

Per session 296 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00296 $0.03703
Opus 5 $0.00148 $0.01852
Sonnet 5 $0.00059 $0.00741
Haiku 4.5 $0.00030 $0.00370

Measured 2d ago against content hash 4d64938f3964, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bmob-database-javascript scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

description: "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) cov
skills/bmob-database-javascript/SKILL.md · 284 lines

How it starts

The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bmob Database — JavaScript / 跨端 SDK

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-sdkBmob.Query('X') Promise 风格,3.0+)。基于 Backbone.js 的旧 bmob-min.jsBmob.Object.extend("X") callback 风格)不要用,也不要回退

核心原则

1. 初始化支持两种方式(hydrogen-js-sdk 3.0+ 均兼容;按场景二选一,不要混用):

方式 A — Secret Key + API 安全码推荐:浏览器 / 小程序 / 公开客户端,SDK 内部走加密授权):

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):

Bmob.initialize("你的Application ID", "你的REST API Key");
  • Application ID / REST API Key:控制台 → 应用 → 设置 → 应用密钥 同一页。
  • REST API 请求域名一般为 https://api.codenow.cn(见 bmob-database-restful)。

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 动态取 tags.latest 再拼 URL(见 references/platform-init.md)。禁止在示例里写 @2.7.3 这类会过期的具体版本。

3. 默认查询返回 100 条,最大 1000。需要更多用 skip + limit 分页或走 BQL(bmob-bql skill)。

4. 三个保留字段不能手动写入objectIdcreatedAtupdatedAt。读 objectId 时用 res.objectId(不是 id)。

5. 时间字段比较的精度createdAt / updatedAt 在服务器是微秒精度,应用层做时间比较时要 +1 秒。

安全清单

  • 密钥分级:浏览器 / 小程序 / 移动端优先 Secret Key + API 安全码(方式 A),永不用 Master Key。若用 Application ID + REST API Key(方式 B),REST API Key 会暴露在 bundle 中。
  • 生产环境关闭调试模式Bmob.debug(true) 仅在小程序开发时使用,上线前删掉。
  • 小程序必须配置服务器域名白名单:微信后台 request 合法域名至少添加 https://api.bmobcloud.com(见 references/platform-init.md 微信小程序段)。
  • 微信小程序若使用 npm 引入 SDK,需先在开发者工具执行“工具 --> 构建 npm”:未构建时 import Bmob from "hydrogen-js-sdk" 不会生效。
  • 写入的表必须配 ACL:否则任意用户可改任意行。参见 bmob-acl-and-roles(P1)。
  • 批量操作上限 50 条(含批量更新、批量删除)。超出需循环。
  • 批量查询上限 100 条 / 单次 1000 条:避免一次拉全表。
  • Bmob.User.login 在小程序里要先调用 wx.login() 获取 code,否则会话拿不到 sessionToken。

Read the full file on GitHub · 284 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 284 lines · 296 tokens per session scan A 4d64938f3964

Subscribe to this mod's changes

bmob-database-javascript is a skill published in the GitHub repository bmob/agent-skills (3 stars, last pushed 1mo ago), licensed MIT. It adds 296 tokens to every session and 3,703 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

one-on-one-prep

Deep-dive preparation for 1:1 meetings with direct reports. Surfaces recent work, wins, friction, wellbeing signals, and development goal progress, anchored in the org's performance framework, organizational values, and management best practices. Produces a prep sheet with suggested conversation topics, not a script.

techwolf-ai/ai-first-toolkit · 67 tokens

performance-cycle

Evidence gathering for performance review cycles. Gathers goal completion evidence, peer feedback, development progress, scope changes, and values alignment, organised along the org's performance framework dimensions, with organizational values as the 'how' lens. Surfaces evidence gaps. Never suggests ratings, only…

techwolf-ai/ai-first-toolkit · 67 tokens

team-health

Periodic check on team dynamics, engagement signals, and development trajectory for all direct reports. Surfaces patterns across the team: who might need more challenge, who might need more support, who hasn't had a 1:1 recently. Uses two universal lenses: performance & growth, and wellbeing & connection. Outputs are…

techwolf-ai/ai-first-toolkit · 72 tokens

handoff

Write a session handoff at the end of a session so the next session can start from where this one stopped without rereading the whole conversation. Use when user says "handoff", "wrap up", "write a handoff", "end of session", "park this session", "save where we are", or to RESUME with "/handoff read", "pick up the…

techwolf-ai/ai-first-toolkit · 140 tokens

setup-content-studio

Set up a new content studio for a person. Copies the plugin template, adapts it to the person's voice, themes, and content types through interactive discovery. Use when asked to create a content studio for someone new.

techwolf-ai/ai-first-toolkit · 49 tokens

kb-answer

Answer questions using your project's knowledge base with evidence-backed citations. Every answer must cite literal quotes from KB files to prevent hallucinations. Use this for any question that should be answered from documented knowledge rather than general knowledge.

techwolf-ai/ai-first-toolkit · 46 tokens