Overview
This guide will help you integrate Feishu multi-dimensional tables in superun to achieve automatic data synchronization and display. Through Edge Functions calling Feishu Open Platform API, multi-dimensional table data is synchronized to Supabase database and displayed in real-time on the frontend.I. Overall Architecture
Data Flow:- User enters Feishu app credentials + multi-dimensional table link in the frontend
- Edge Function calls Feishu API to validate credentials, parse links, and fetch data
- Data is written to Supabase database (
data_sources/synced_rows/sync_logs) - Frontend reads database in real-time through React Query to display dashboard
II. Feishu Configuration (4 Steps)
Step 1: Create Enterprise Self-built Application
- Open Feishu Open Platform, log in and enter “Developer Console”
-
Click “Create Enterprise Self-built Application”
- Fill in the application name (e.g., “Data Workbench”) and description, then click Create
Step 2: Get Application Credentials
- Enter the application details page, select “Credentials & Basic Info” from the left menu
-
Record App ID and App Secret
- App ID:
cli_a9xxxxxxxxxx← Starts withcli_ - App Secret:
************************← Keep secure, do not leak
⚠️ Note: App Secret is only displayed once. Please keep it secure. If lost, you need to regenerate it.
Step 3: Configure Application Permissions
- Enter “Permission Management”, search and enable the following permissions:
| Permission ID | Description | Required |
|---|---|---|
bitable:app:readonly | Read multi-dimensional table data (tables, fields, records) | Yes |
wiki:wiki:readonly | Read knowledge base node information (for parsing wiki links) | Only needed when table is embedded in knowledge base |
- Create Version and Publish:
- Left menu → “Version Management & Release”
- Create version → Fill in version number and update description
- Submit for release (if it’s an enterprise internal application, usually auto-approved)
💡 Tip: After enabling permissions, you must create a version and publish it for permissions to take effect.
Step 4: Set Multi-dimensional Table Sharing Permissions
Ensure the Feishu application can access the target multi-dimensional table:- Open multi-dimensional table → “Share” button in the top right corner
- Set link permission to “People with link in organization can read”
⚠️ Note: If permissions are set incorrectly, the application will not be able to access multi-dimensional table data.
III. Database Table Structure
The system uses 3 tables to store data:data_sources — Data Source Configuration
synced_rows — Synced Data Rows
sync_logs — Sync Logs
IV. Backend: Edge Function Core Code
Edge Functionfeishu-sync is the core of the integration, providing 3 actions:
4.1 Get tenant_access_token
Prerequisite step for all Feishu API calls, exchange app credentials for access token:4.2 Action: validate — Validate Credentials + Parse Link
Supports two Feishu link formats:| Format | Example |
|---|---|
/base/ direct link | https://xxx.feishu.cn/base/DQu7bPBrEaUxU2s9kkNcWz9zn1B |
/wiki/ knowledge base | https://xxx.feishu.cn/wiki/QFA2wYY62iTFuEkGusSchjomnOh?table=tblxxx |
4.3 Action: metadata — Get Field Definitions
4.4 Action: sync — Full Data Sync
This is the core sync logic, steps as follows:4.5 Multi-dimensional Table Field Value Extraction
Bitable field value formats vary by type, need to uniformly extract as displayable strings:| Field Type | type | Value Example |
|---|---|---|
| Text | 1 | [{type:"text", text:"Hello"}] |
| Number | 2 | 123.45 |
| Single Select | 3 | "Option A" |
| Multi Select | 4 | ["Option A", "Option B"] |
| Date | 5 | 1709251200000 (millisecond timestamp) |
| Checkbox | 7 | true / false |
| Personnel | 11 | [{id:"xxx", name:"John"}] |
| Hyperlink | 15 | {text:"Click", link:"https://..."} |
V. Frontend: React Hooks Call Layer
5.1 Validate Connection
5.2 Trigger Sync
5.3 Data Source CRUD
VI. Complete Integration Flow Diagram
VII. Common Issues Troubleshooting
| Error Message | Cause | Solution |
|---|---|---|
| Failed to get access token (code: 10003) | App ID or App Secret is incorrect | Check if credentials are copied correctly |
| Access denied…wiki:wiki:readonly | Application lacks knowledge base read permission | Enable wiki:wiki:readonly permission and publish new version |
| Failed to get data table list (code: 99991668) | Application lacks multi-dimensional table permission | Enable bitable:app:readonly permission |
| Failed to get records (code: 1254607) | Application has no access to the multi-dimensional table | Set multi-dimensional table link sharing to “People with link in organization can read” |
| This knowledge base node is not a multi-dimensional table | Link points to a document instead of multi-dimensional table | Confirm the pasted link actually points to a multi-dimensional table page |
| Cannot parse Token from URL | URL format is incorrect | Use complete link in /wiki/xxx or /base/xxx format |
| violates check constraint | Database status constraint mismatch | Check if status field’s check constraint includes required value |
superun Website
Visit this website to learn more about features and examples.

