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.
Optimize Cold Start Performance for WeChat Mini Program Cloud Functions
Four actionable techniques to reduce CloudBase Cloud Function cold start latency: move initialization out of the handler, trim dependencies, tune memory, and enable Per-instance Concurrency. Full code included.
Proxy Deepgram Speech-to-Text via CloudBase Cloud Function
Use @deepgram/sdk in a CloudBase Cloud Function to call nova-3, transcribe audio from Cloud Storage with timestamps and speaker diarization, and write results back to the database.
Proxy fal.ai FLUX Image Generation via CloudBase Cloud Function
Call fal.ai's FLUX model from a CloudBase Cloud Function using @fal-ai/client, save the generated image to Cloud Storage, and return a temporary URL to the frontend.
Proxy Overseas LLM APIs (OpenAI / Anthropic) via Cloud Function
Build a thin reverse proxy in a CloudBase Web Cloud Function (HTTP trigger) to handle overseas LLM access, keep API keys out of the frontend, and pass through SSE streaming responses.
Proxy Tavily AI Search via CloudBase Cloud Function
Use @tavily/core in a CloudBase Cloud Function to call the Tavily Search API, wrap real-time web retrieval for LLM agents into an HTTP-triggered function, and let frontends / Mini Programs call it directly without exposing the API key.
Pull Cloud Function Logs with manager-node and Alert Failures to WeCom
Run a monitoring Cloud Function on a cron schedule. Use @cloudbase/manager-node's getFunctionLogsV2 to pull Cloud Function logs from the past 5 minutes, treat RetCode 500 as errors, and send alerts to a WeCom Group Bot with threshold checks and deduplication.
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 Transactional Email via Resend in a Cloud Function
Use the Resend Node SDK inside a CloudBase Web Cloud Function (HTTP trigger) to send transactional emails — registration confirmation, password reset, billing alerts, agent notifications — with SPF/DKIM managed automatically by Resend, a custom sender domain, and optional React Email templates.
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.
Send WeCom Group Bot Messages with a CloudBase Cloud Function
Use a CloudBase Cloud Function to push text, Markdown, images, and other message types to a WeCom Group Bot via Webhook. Add a timer trigger for monitoring alerts.
WxCloudSDKError: [Error] secret id error
When locally debugging cloud functions in WeChat Developer Tools, you may encounter the error message WxCloudSDKError: [Error] secret id error. This error is usually caused by the local debugging environment failing to correctly verify secretId.