Add Authentication to a UniApp Project with CloudBase
Use @cloudbase/adapter-uni-app in a UniApp project to integrate CloudBase Auth. One codebase runs across H5, WeChat Mini Program, Alipay Mini Program, Douyin Mini Program, iOS, and Android with shared login state.
Add Authentication to a Web React Project with CloudBase SDK
Use @cloudbase/js-sdk in a Vite + React 18 project to integrate CloudBase Authentication. Covers SMS Verification Code, email verification code, and WeChat QR Login, with persistent login state and a Route Guard.
Add CloudBase AI (DeepSeek / Hunyuan) to a React Native App
RN 0.74+ mobile apps use a two-stage 'frontend fetch + backend proxy' pattern: a backend Route Handler (Next.js / Cloud Function / Cloud Run, your choice) uses @cloudbase/node-sdk's app.ai().createModel('cloudbase').streamText({model: 'deepseek-v4-flash'}) to return a text/plain streaming Response; the RN frontend reads the stream with fetch + body.getReader() (or react-native-fetch-api polyfill / XHR onprogress fallback) and renders text character by character in a FlatList. SecretId / SecretKey must never appear in the JS bundle — RN bundles are plaintext and can be decompiled by anyone.
Add CloudBase AI (DeepSeek / Hunyuan) to a WeChat Mini Program
Use wx.cloud.extend.AI to call DeepSeek / Hunyuan and other CloudBase platform models directly from a Mini Program frontend, consume textStream with for-await for streaming output, no self-hosted LLM gateway required.
Add CloudBase AI (DeepSeek / Hunyuan) to Next.js
Use @cloudbase/node-sdk in a Next.js Route Handler to call CloudBase AI streamText, convert AsyncIterable to ReadableStream for the frontend, and consume the streaming response in a Client Component with fetch + getReader.
Add CloudBase Authentication to Next.js
Use @cloudbase/js-sdk in a Next.js 14+ App Router project to integrate anonymous/SMS/WeChat QR Login, store login state in cookies, read identity in Server Components via cookies(), and intercept unauthenticated requests with middleware.
Add CloudBase Authentication to WeChat Mini Programs
Use @cloudbase/js-sdk@2.27.3 + @cloudbase/adapter-wx_mp@1.3.1 to let a WeChat Mini Program log in to a standalone CloudBase Environment using a ticket issued by a Cloud Function.
Build a Browser Voice Chatbot with Deepgram + CloudBase AI
Browser MediaRecorder captures audio → a Cloud Function proxies Deepgram nova-3 for STT → CloudBase AI streamText streams the reply → SpeechSynthesisUtterance reads it aloud in real time. A complete push-to-talk loop with no credentials exposed to the browser.
Build RAG with CloudBase PostgreSQL + pgvector
Enable the pgvector extension on CloudBase PostgreSQL, write a pair of ingest / retrieve Cloud Functions, and run the complete RAG pipeline: document chunking → embeddings → vector search → prompt assembly → LLM answer.
Call a CloudBase Cloud Function in WeChat Mini Program
Use wx.cloud.callFunction to call a Cloud Function directly from a Mini Program. The Cloud Function side uses wx-server-sdk to automatically obtain the OPENID — no auth token required, BaaS-style calls.
Connect CloudBase MCP to Claude Code — Control CloudBase Resources with Natural Language
claude mcp add cloudbase -- npx -y @cloudbase/cloudbase-mcp@latest — gives Claude Code 36 CloudBase tools (database / cloud functions / static hosting / cloud run / cloud storage / search / AI Agent) so you can go from a single natural-language prompt to a fully deployed CloudBase application.
Deploy a React SPA to CloudBase Hosting
Run vite build to generate dist, upload to CloudBase static website Hosting via tcb hosting deploy, get automatic CDN acceleration + HTTPS; configure index.html as the error page fallback in the Console to resolve React Router refresh 404s.
Deploy a Vue SPA to CloudBase Hosting
Run vite build to generate dist, upload to CloudBase static website Hosting via tcb hosting deploy, get automatic CDN acceleration + HTTPS; configure index.html as the error page fallback for Vue Router history mode.
File Upload in WeChat Mini Program with CloudBase Cloud Storage
Use wx.chooseMedia to select media, upload to Cloud Storage via @cloudbase/js-sdk's uploadFile, store the fileID in the database, and render with getTempFileURL. Covers cloudPath naming, Temporary URL caching, and Security Rules.
Long Document Q&A with DeepSeek V4 1M-Token Context (No RAG)
Parse PDF / entire codebases / Excel files into plain text, feed the full content into the prompt, and call CloudBase AI streamText({ model: 'deepseek-v4-pro' }) to answer questions in one shot — skipping embeddings and vector databases, ideal for one-off long-document Q&A.
Multimodal Image Understanding with DeepSeek V4-Pro in CloudBase AI
A Next.js Route Handler receives user-uploaded images, converts them to base64, and calls @cloudbase/node-sdk's app.ai().createModel('cloudbase').generateText with model: 'deepseek-v4-pro' using multimodal messages to get image descriptions, OCR results, and content analysis. Covers single image, multiple images, and image + text prompts.
Parameterized Sharing and Conversion Funnel in WeChat Mini Program
Use onShareAppMessage / onShareTimeline to embed inviter and other parameters in share links, store incoming data to CloudBase Database on the receiving end, and generate parameterized wxacode posters via Cloud Functions.
Read and Write CloudBase Database in Next.js Server Components
Use @cloudbase/node-sdk to directly await the database in a Next.js App Router Server Component, write data via Server Action, refresh the cache with revalidatePath, and let Client Components receive results through Server Actions.
Read and Write CloudBase Database in WeChat Mini Program
After login, use the db API from @cloudbase/js-sdk to perform collection CRUD, conditional queries, and real-time watch subscriptions in a WeChat Mini Program frontend, including Permission Mode selection and unsubscribe considerations.
Realtime Notifications with CloudBase Database watch
In a WeChat Mini Program with authentication already integrated, use db.collection().watch() to push order status updates, message alerts, and online presence sync. Covers the initial snapshot, docChanges increments, connection management, and when to call close().
Run Cron Jobs with CloudBase Cloud Function Timer Triggers
Configure a timer trigger in cloudbaserc.json to run daily reports, data cleanup, and cache warming. Covers the 7-field cron format, idempotency for duplicate-run prevention, and failure alerts via WeCom webhook.
Send WeChat Mini Program Subscribe Messages via Cloud Function
The Mini Program frontend obtains user authorization via wx.requestSubscribeMessage, the server uses cloud.openapi.subscribeMessage.send to deliver messages, covering differences between one-time and long-term subscriptions and handling of 43101/47003 errors.
Streaming Chatbot on CloudBase: Three Implementation Paths
Use the official cloudbase-agent-ui component, hand-written SSE + Cloud Function, or Vercel AI SDK to build a streaming chat interface on CloudBase — pick the path that fits your team, frontend, and complexity.