React Native Quick Start
- AI Quick Start
- Full Developer Guide
Prerequisites
Before you begin, ensure you have completed the following:
- Activate CloudBase Environment: Create Environment
- Get API Credentials: Get your environment ID and API key from CloudBase Console
Client
Configure your AI tool to connect with CloudBase capabilities. Supports local and hosted connection. See connection modes.
Step 1: Install / Configure CloudBase
Step 2: Chat with AI
Enter the following in your AI chat in order:
prompt
Install CloudBase Skills: run npx skills add tencentcloudbase/cloudbase-skills -yUse CloudBase Skills: Use CloudBase Skills: Integrate CloudBase HTTP API in a React Native appPrerequisites
Before you begin, ensure you have completed the following:
- Activate CloudBase Environment: Create Environment
- Get API Credentials: Get your environment ID and API key from CloudBase Console
For more details, see: React Native Full Documentation
Install SDK
@cloudbase/js-sdk Combine with @cloudbase/adapter-rn allows you toin React Native project
npm
npm i @cloudbase/js-sdk @cloudbase/adapter-rn
yarn
yarn add @cloudbase/js-sdk @cloudbase/adapter-rn
pnpm
pnpm add @cloudbase/js-sdk @cloudbase/adapter-rn
iOS needInstallNativeDependency:
cd ios && pod install && cd ..
Initialize SDK
Add the following code to your React Native project
src/utils/cloudbase.js
import cloudbaseSDK from "@cloudbase/js-sdk";
import adapter from "@cloudbase/adapter-rn";
cloudbaseSDK.useAdapters(adapter);
const cloudbase = cloudbaseSDK.init({
// Environment ID
env: "{%ENV_ID%}",
// region
region: "{%REGION%}",
// Anonymous access token
accessKey: "{%PUBLISHABLE_KEY%}"
});
export default cloudbase;