Skip to main content

18 docs tagged with "add"

View All Tags

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 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.

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.

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.

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().

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.