### Configure Custom Domain in Superun Backend Source: https://docs.superun.ai/superun/detailed-tips-modules/domain-seo-guide This section details the process of setting up a custom domain for a project using the Superun backend interface. It guides users through navigating to the search optimization settings, initiating the custom domain setup, inputting domain information, and selecting a domain provider. The process involves several steps, including clicking specific buttons and entering domain names. ```Markdown ## Usage Guide ### Custom Domain Configuration Steps Configure a custom domain through the superun backend to bind your project to your own domain, improving brand image and SEO. **Configuration Steps**: 1. **Enter Search Optimization Settings** * On the project page, click the **Operations** tab in the top navigation bar * In the left sidebar, click **Search Optimization** * In the “Domain” area, click the **+ Custom Domain** button ![Operations - Search Optimization Interface](https://b.ux-cdn.com/uxarts/files/t20260227141920/9oxzhbmd.png) 2. **Start Configuration Process** * After the configuration dialog appears, click the **Continue** button ![Configuration Dialog Initial Page](https://b.ux-cdn.com/uxarts/files/t20260227141920/e3oulmjc.png) 3. **Enter Domain** * Enter your first-level domain in the input box (e.g., `yourdomain.com`) * If you need to use a subdomain, you can check the “I want to use a subdomain” option * After entering, click the **Continue** button ![Domain Input Page](https://b.ux-cdn.com/uxarts/files/t20260227141920/w4lafv9q.png) 4. **Select Domain Provider** * If your domain provider is in the list, you can select it directly * If you can’t find your provider, scroll down to the bottom of the page * Click **Go to our manual setup** to enter manual configuration ``` -------------------------------- ### SMTP Server Configuration Examples for Superun Source: https://docs.superun.ai/superun/skills/configure-163-smtp Provides alternative SMTP server addresses for sending emails through Superun. This is useful if the default 163.com server is not suitable or for using other email providers. The example lists 'smtp.126.com' and 'smtp.yeah.net' as alternative server addresses, noting that other parameters like port and authorization code usage are similar to the 163.com setup. ```text smtp.126.com ``` ```text smtp.yeah.net ``` -------------------------------- ### Frontend Integration with React Source: https://docs.superun.ai/superun/skills/ready-to-use/amap Example of importing useEffect and configuring headers for the Amap loader in a React component. ```jsx import { useEffect }; headers: { "Content-Type": "application/json" } ``` -------------------------------- ### Perform HTTP Requests via Proxy Source: https://docs.superun.ai/superun/skills/proxy-forward Examples of performing GET and PUT requests using the proxyFetch utility. The GET example demonstrates retrieving an access token, while the PUT example shows how to send a JSON payload with Authorization headers. ```javascript // GET request (WeCom get access_token): const url = `https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=${corpId}&corpsecret=${corpSecret}`; const resp = await proxyFetch(url); const data = await resp.json(); // PUT request with Authorization: const resp = await proxyFetch( "https://some-platform.com/api/resource/123", { method: "PUT", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${accessToken}`, }, body: JSON.stringify({ name: "updated" }), } ); ``` -------------------------------- ### Initialize WxLogin SDK Source: https://docs.superun.ai/superun/skills/configure-wechat-qrcode-oauth This snippet demonstrates the configuration object structure for initializing the WxLogin SDK. It includes essential parameters like redirect_uri, state for CSRF protection, and visual style settings. ```javascript new WxLogin({ id: "login_container", appid: "YOUR_APPID", scope: "snsapi_login", redirect_uri: encodeURIComponent("YOUR_REDIRECT_URI"), state: "CSRF_TOKEN", // CSRF state style: "black" // QR code style: black / white }); ``` -------------------------------- ### Usage Example: GET Request for WeCom Access Token Source: https://docs.superun.ai/superun/skills/proxy-forward Demonstrates how to construct a GET request to obtain an access token from WeCom using the Superun AI LLMs TXT service. ```APIDOC ## Usage Example: GET Request for WeCom Access Token ### Description This example shows a practical application of a GET request, specifically for fetching a WeCom access token. It includes constructing the URL with necessary parameters. ### Method GET ### Endpoint /llmstxt/superun_ai_llms_txt (example usage) ### Parameters #### Query Parameters - **corpid** (string) - Required - The Corp ID for WeCom. ### Request Example ```typescript const url = `https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=${corpId}`; // Further request logic would follow here, potentially using fetch or a similar library. ``` ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **expires_in** (integer) - The validity period of the token in seconds. #### Response Example ```json { "access_token": "YOUR_ACCESS_TOKEN", "expires_in": 7200 } ``` ``` -------------------------------- ### Initialize Supabase Client in Deno Source: https://docs.superun.ai/superun/integrations/sms-login Demonstrates how to instantiate the Supabase client using the createClient function, retrieving the URL from Deno environment variables. ```typescript const supabase = createClient(Deno.env.get("SUPABASE_URL") ?? ""); ``` -------------------------------- ### Initialize and Configure QRLogin Component Source: https://docs.superun.ai/superun/skills/feishu/feishu-qrcode-oauth-guide This snippet demonstrates the initialization of the QRLogin component with specific parameters like containerId, gotoUrl, and dimensions. It also shows how to assign the instance to a ref and update the component status. ```javascript window.QRLogin({ id: containerId, goto: gotoUrl, width, height }); qrLoginRef.current = qrLoginInstance; setStatus("ready"); // 4. Listen for scan events const handleMessage = (event) => { ... }; ``` -------------------------------- ### Feishu Multi-dimensional Table Data Sync Source: https://docs.superun.ai/llms.txt Guide for integrating Feishu multi-dimensional table data synchronization. Includes Feishu configuration, database table structure, Edge Function core code, and frontend call examples. ```javascript async function syncFeishuData(req, res) { const { tableId, viewId } = req.body; console.log('Syncing Feishu data for table:', tableId, 'view:', viewId); // 1. Get Feishu access token const accessToken = await getFeishuAccessToken(); // 2. Fetch data from Feishu multi-dimensional table const feishuData = await fetchFeishuTableData(accessToken, tableId, viewId); // 3. Process and sync data with your database await syncToDatabase(feishuData); res.json({ message: 'Feishu data synced successfully' }); } async function getFeishuAccessToken() { // Implementation to obtain Feishu access token using app credentials return 'your_feishu_access_token'; } async function fetchFeishuTableData(accessToken, tableId, viewId) { // Implementation to fetch data using Feishu API return [{ field1: 'value1', field2: 'value2' }]; } async function syncToDatabase(data) { // Implementation to insert or update data in your database console.log('Syncing data to database:', data); } ``` -------------------------------- ### Initialize and Handle QR Login Events Source: https://docs.superun.ai/superun/skills/feishu/feishu-qrcode-oauth-guide This code snippet shows the initialization of a QR login instance via a ref, updating the component status to 'ready', and setting up a message event listener to handle incoming scan events. ```javascript width, height }); qrLoginRef.current = qrLoginInstance; setStatus("ready"); // 4. Listen for scan events const handleMessage = (event: MessageEvent) => { if (qrLoginInstance) { // Logic to handle scan event } }; ``` -------------------------------- ### String Slicing Example in JavaScript Source: https://docs.superun.ai/superun/skills/configure-alipay-pay This code snippet demonstrates how to extract a portion of a string using the slice() method in JavaScript. It takes a string and returns a new string containing characters from a specified start index up to (but not including) a specified end index. This is useful for extracting specific parts of a string. ```javascript const dateStr = "2023-10-27"; const slicedStr = dateStr.slice(0, 14); ``` -------------------------------- ### Initialize Supabase and Retrieve Alipay Config Source: https://docs.superun.ai/superun/skills/configure-alipay-pay This snippet shows the initialization of a Supabase client and the retrieval of sensitive Alipay credentials from environment variables using Deno.env.get(). It also includes a conditional check structure for validation. ```typescript createClient(supabaseUrl, supabaseKey); // Get Alipay configuration const appId = Deno.env.get("ALIPAY_APP_ID"); const privateKey = Deno.env.get("ALIPAY_PRIVATE_KEY"); if (!appId) { ``` -------------------------------- ### Initialize and Configure Superun AI Source: https://docs.superun.ai/superun/skills/all This JavaScript snippet initializes the Superun AI application with specified configurations, including auto-boot, authentication, and git source details. It also sets up the documentation theme, name, and description. ```javascript function(){ var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z; try{ for(a=document.cookie.split('; '),b=0;b { // Get the Unsplash access key from environment variables const accessKey = Deno.env.get("SUPERUN_UNSPLASH_ACCESS_KEY"); if (!accessKey) { return new Response("Missing SUPERUN_UNSPLASH_ACCESS_KEY environment variable.", { status: 500, }); } // Placeholder for actual image fetching logic // ... return new Response("Hello from Superun AI LLMs!"); }); ``` -------------------------------- ### Initialize and Configure Superun AI LLMs Source: https://docs.superun.ai/superun/detailed-tips-modules/consultation-guide This snippet demonstrates how to initialize and configure the Superun AI LLMs, setting up essential parameters for its operation. It includes configurations for language, theme, and other project-specific settings. ```javascript function initializeSuperunAI(config) { // Initialize LLM with provided configuration console.log('Initializing Superun AI LLMs with config:', config); // ... actual initialization logic ... } const defaultConfig = { language: 'en', theme: 'mint', // ... other default settings ... }; initializeSuperunAI(defaultConfig); ``` -------------------------------- ### WeCom QR Code Login and Enterprise Member Validation Guide Source: https://docs.superun.ai/llms.txt This guide details the integration of WeCom OAuth 2.0 QR code login with an embedded scan panel. It ensures that only enterprise members can log in, enhancing security for internal applications. -------------------------------- ### JavaScript: Handle Message and SDK Initialization Source: https://docs.superun.ai/superun/skills/feishu/feishu-qrcode-oauth-guide This JavaScript code snippet demonstrates how to handle messages, load an SDK, and initialize it. It includes error handling for cases where the cleanup process might have already occurred, setting status and error messages accordingly. ```javascript handleMessage().catch(err => { if (!isCleanedUp) { setStatus("error"); setErrorMessage(err.message); } }); return () => {}; ``` -------------------------------- ### Install Amap JSAPI Loader Source: https://docs.superun.ai/superun/skills/ready-to-use/amap Install the official Amap JavaScript API loader via npm to manage map script loading. ```bash npm i @amap/amap-jsapi-loader@1.0.1 --save ``` -------------------------------- ### GET /api/subscription/{customerId} Source: https://docs.superun.ai/superun/integrations/stripe Fetches the subscription details for a given customer ID. It makes a GET request to the API, parses the JSON response, and updates the subscription state. ```APIDOC ## GET /api/subscription/{customerId} ### Description Fetches the subscription details for a given customer ID. This endpoint retrieves subscription information and handles potential errors during the fetch process. ### Method GET ### Endpoint `/api/subscription/{customerId}` ### Parameters #### Path Parameters - **customerId** (string) - Required - The unique identifier for the customer. ### Request Example ```json { "customerId": "cus_123abc" } ``` ### Response #### Success Response (200) - **subscription** (object) - Contains the subscription details for the customer. #### Response Example ```json { "subscription": { "id": "sub_456def", "status": "active", "plan": "premium" } } ``` ### Error Handling - **404 Not Found**: If the customer ID is not found. - **500 Internal Server Error**: If there is a server-side issue. ``` -------------------------------- ### Supabase Client Initialization with Deno Source: https://docs.superun.ai/superun/integrations/sms-login This code snippet shows how to initialize the Supabase client using Deno environment variables. It retrieves the Supabase URL and anon key from environment variables to establish a connection. ```javascript const supabase = createClient( Deno.env.get("SUPABASE_URL"), Deno.env.get("SUPABASE_ANON_KEY") ); ``` -------------------------------- ### Initialize Query Client with useQueryClient (JavaScript) Source: https://docs.superun.ai/superun/skills/feishu/feishu-sync-guide Demonstrates initializing a query client using the `useQueryClient` hook. This is a common pattern in React applications for managing server state. It requires the `@tanstack/react-query` library. ```javascript const queryClient = useQueryClient(); ``` -------------------------------- ### Install Amap Loader Source: https://docs.superun.ai/superun/skills/ready-to-use/amap This code snippet shows the command to install the Amap JavaScript API loader. This is a necessary step to integrate Amap services into your web application. ```bash npm install @amap/amap-jsapi-loader ``` -------------------------------- ### Constructing a WeCom GET Request URL Source: https://docs.superun.ai/superun/skills/proxy-forward This snippet demonstrates how to construct a URL for a GET request to the WeCom API to retrieve an access token. It uses template literals to inject the corpId into the endpoint path. ```typescript const url = `https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=${corpId}`; ``` -------------------------------- ### Initialize and Configure Superun AI Application Source: https://docs.superun.ai/superun/features/image-upload This JavaScript snippet initializes the Superun AI application with specified configurations. It handles application ID, auto-boot behavior, and user authentication settings. It also configures the documentation theme, name, description, colors, logo, and navigation links. ```javascript (() => { const a = {}; const b = localStorage.getItem('data-banner-state'); const f = 'bannerDismissed'; let k = true; let l = 0; const d = 'data-banner-state'; const g = 'lang'; for (let i = 0; i < arguments.length; i++) { const item = arguments[i]; if (item && typeof item === 'string' && item.startsWith('lang:')) { const lang = item.substring(5); if (!['en', 'zh-Hant', 'zh-Hans'].includes(lang)) { continue; } } if (b && b === f) { k = false; break; } if (g && (a.startsWith(`lang:${g}_`) || !a.startsWith("lang:"))) { localStorage.removeItem(a); l--; } } document.documentElement.setAttribute(d, k ? 'visible' : 'hidden'); })( {}, 'en', ['en', 'zh-Hant', 'zh-Hans'], 'data-banner-state', 'bannerDismissed') const config = { appId: undefined, autoBoot: true, children: [ { value: { auth: undefined, userAuth: undefined }, children: [ { value: { subdomain: 'uxarts', actualSubdomain: 'uxarts', gitSource: { type: 'github', owner: 'qianwujie0905', repo: 'documentation', deployBranch: 'main', contentDirectory: '', isPrivate: true }, inkeep: undefined, chroma: { liveDeploymentHistoryId: '69c6348b83767cbcee81e70b', collectionId: '46e4d4b0-54a6-4515-8456-b740c9276e83' }, feedback: undefined, entitlements: undefined, buildId: '69c6348b83767cbcee81e70b:success', clientVersion: '0.0.2717', preview: undefined, searchFilterCounts: [ { language: 'en', tag: 'superun', count: 68 }, { language: 'zh-Hans', tag: 'superun', count: 68 }, { language: 'zh-Hant', tag: 'superun', count: 68 }, { language: 'en', tag: 'Prompt.to.design', count: 39 }, { language: 'zh-Hans', tag: 'Prompt.to.design', count: 39 }, { language: 'zh-Hant', tag: 'Prompt.to.design', count: 39 }, { language: 'en', tag: 'Use Cases', count: 31 }, { language: 'zh-Hans', tag: '使用案例', count: 31 }, { language: 'zh-Hant', tag: '使用案例', count: 31 }, { language: 'en', tag: 'User Guides', count: 27 }, { language: 'zh-Hans', tag: '使用指南', count: 27 }, { language: 'zh-Hant', tag: '使用指南', count: 27 }, { language: 'en', tag: 'Workflow', count: 18 }, { language: 'zh-Hans', tag: '工作流程', count: 18 }, { language: 'zh-Hant', tag: '工作流程', count: 18 }, { language: 'en', tag: 'Templates', count: 16 }, { language: 'zh-Hans', tag: '模板', count: 16 }, { language: 'zh-Hant', tag: '模板', count: 16 }, { language: 'en', tag: 'Features', count: 15 }, { language: 'zh-Hans', tag: '功能', count: 15 }, { language: 'zh-Hant', tag: '功能', count: 15 }, { language: 'en', tag: 'Tutorials', count: 10 }, { language: 'en', tag: 'Build', count: 10 }, { language: 'zh-Hans', tag: '教学范例', count: 10 }, { language: 'zh-Hans', tag: '研发', count: 10 }, { language: 'zh-Hant', tag: '教學範例', count: 10 }, { language: 'zh-Hant', tag: '研發', count: 10 }, { language: 'en', tag: 'Integrations', count: 9 }, { language: 'zh-Hans', tag: '集成', count: 9 }, { language: 'zh-Hant', tag: '集成', count: 9 } ] }, children: [ { value: { docsConfig: { theme: 'mint', '$schema': 'https://mintlify.com/docs.json', name: 'Documentation', description: 'superun and Prompt.to.design Documentation: Complete guides for AI-powered app building, visual editing, Figma plugin, and integrations.', colors: { primary: '#16A34A', light: '#07C983', dark: '#15803D' }, logo: { light: 'https://mintcdn.com/uxarts/7KDEiYoIS_Xa2Lw9/logo/superun-light.png?fit=max&auto=format&n=7KDEiYoIS_Xa2Lw9&q=85&s=48c1b54168c9db5fb21a0353a2422115', dark: 'https://mintcdn.com/uxarts/7KDEiYoIS_Xa2Lw9/logo/superun-dark.png?fit=max&auto=format&n=7KDEiYoIS_Xa2Lw9&q=85&s=08216634a8084773c4e6348d0bbb2d83', href: 'https://superun.ai/' }, favicon: 'public/favicon.png', navbar: { links: [], primary: { type: 'button', label: 'superun', href: 'https://superun.ai/' } }, navigation: { global: { anchors: [] }, languages: [ { language: 'en', tabs: [ { tab: 'Overview', groups: [ { group: '​', pages: ['index'] } ] }, { tab: 'superun', groups: [ { group: 'Guide', pages: [ 'superun/introduction/welcome', 'superun/introduction/getting-started', 'superun/introduction/faq' ] }, { group: 'Workflow', pages: [ { group: 'Idea', pages: ['superun/features/prompt-question'] } ] } ] } ] } ] } } } } ] } ] } ] }; console.log(config); ``` -------------------------------- ### TypeScript API Call Example Source: https://docs.superun.ai/superun/skills/configure-wechat-official-account Example of how to call Superun AI LLMs TXT APIs from a frontend using TypeScript and Supabase client. This snippet demonstrates importing necessary modules and making API calls. ```typescript import { supabase } from "@/integrations/supabase/client" // Example function to get menu data async function getMenu() { const { data, error } = await supabase.rpc('get_menu') if (error) console.error(error) return data } // Example function to get follower count async function getFollowerCount() { const { data, error } = await supabase.rpc('get_follower_count') if (error) console.error(error) return data } // Example function to get user summary data async function getUserSummary(days: number = 7) { const { data, error } = await supabase.rpc('user_summary', { days: days }) if (error) console.error(error) return data } // Example function to get user cumulative data async function getUserCumulate(days: number = 7) { const { data, error } = await supabase.rpc('user_cumulate', { days: days }) if (error) console.error(error) return data } // Example function to get article summary data async function getArticleSummary(days: number = 1) { const { data, error } = await supabase.rpc('article_summary', { days: days }) if (error) console.error(error) return data } // Example function to get article total data async function getArticleTotal(days: number = 1) { const { data, error } = await supabase.rpc('article_total', { days: days }) if (error) console.error(error) return data } // Example function to get upstream message data async function getUpstreamMsg(days: number = 7) { const { data, error } = await supabase.rpc('upstream_msg', { days: days }) if (error) console.error(error) return data } // Example function to get interface summary data async function getInterfaceSummary(days: number = 30) { const { data, error } = await supabase.rpc('interface_summary', { days: days }) if (error) console.error(error) return data } ``` -------------------------------- ### Initialize WxLogin SDK with QR Code Source: https://docs.superun.ai/superun/skills/configure-wechat-qrcode-oauth This JavaScript code snippet demonstrates how to initialize the WxLogin SDK. It configures parameters such as appid, scope, redirect_uri, and state to generate a QR code for website app login. The SDK requires an HTML element with a specified ID to render the QR code. ```javascript const wxLogin = new WxLogin({ id: "login_container", appid: "", scope: "snsapi_login", redirect_uri: encodeURIComponent("redirectUri"), state: "", style: "black", }); ``` -------------------------------- ### Publish to WeChat Example Source: https://docs.superun.ai/superun/skills/configure-wechat-official-account This code snippet illustrates the process of publishing content to WeChat. It appears to be a JavaScript example that defines a configuration object for publishing, likely intended for use with a SuperAI or similar platform's API. ```javascript // Publish to WeChat const { publish } = require('superai-sdk'); publish.wechat({ title: 'My Article Title', content: '

This is the article content.

', author: 'John Doe', digest: 'A brief summary of the article.' }); ``` -------------------------------- ### Improve Demo Features and Tutorials Source: https://docs.superun.ai/superun/changelog Optimizes the demo viewing flow with enhanced guidance messages. The tutorial now supports internationalization and uses a skeleton screen for image loading, improving user experience and accessibility. ```javascript children: _jsx("_components.p", { children: "Demo and tutorial improvements: Optimized demo viewing flow with better guidance messages; tutorial now supports internationalization with skeleton screen loading for images." }) ``` -------------------------------- ### JavaScript: Fetch Data with GET Request Source: https://docs.superun.ai/superun/skills/proxy-forward This snippet demonstrates how to perform a GET request to fetch data from a specified URL using the 'proxyFetch' function. It handles the response by converting it to JSON format. This is useful for retrieving information from an API. ```javascript const resp = await proxyFetch(url); const data = await resp.json(); ``` -------------------------------- ### Configure Domain Binding Steps Source: https://docs.superun.ai/superun/detailed-tips-modules/domain-seo-guide A sequence of steps to correctly bind a domain to the Superun backend by updating nameservers in the registrar and waiting for DNS propagation. ```text 1. Change nameserver to Cloudflare at domain registrar 2. Bind domain through Cloudflare in superun backend 3. Wait for DNS to take effect (usually a few minutes to hours) ``` -------------------------------- ### Initialize Supabase Client and Query Data Source: https://docs.superun.ai/superun/skills/configure-alipay-pay This snippet demonstrates how to retrieve environment variables for the Supabase service role key, initialize the Supabase client, and perform a data query. ```typescript const supabaseKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!; const supabase = createClient(supabaseUrl, supabaseKey); // Find local order const { data: order } = await supabase.from("orders").select("*").eq("id", orderId).single(); ``` -------------------------------- ### WeChat API: Get Follower Count Source: https://docs.superun.ai/superun/skills/configure-wechat-official-account This snippet describes the 'get-follower-count' action for the WeChat API. It uses the `GET /cgi-bin/user/get` endpoint to fetch the total number of followers for a given account. This is a common requirement for analyzing audience growth and engagement. ```plaintext action: get-follower-count WeChat API: GET /cgi-bin/user/get Description: Get total followers Date Limit: None ``` -------------------------------- ### Initialize Supabase Client in JavaScript Source: https://docs.superun.ai/superun/skills/configure-alipay-pay This snippet demonstrates how to initialize the Supabase client using environment variables for the URL and anon key. It assumes the existence of `supabaseUrl` and `supabaseKey` which are typically fetched from environment configurations. ```javascript const supabaseUrl = Deno.env.get("SUPABASE_URL"); const supabaseKey = Deno.env.get("SUPABASE_KEY"); const supabase = createClient(supabaseUrl, supabaseKey); ``` -------------------------------- ### GET /cgi-bin/user/get Source: https://docs.superun.ai/superun/skills/configure-wechat-official-account Retrieves the total number of followers. ```APIDOC ## GET /cgi-bin/user/get ### Description Get total followers ### Method GET ### Endpoint /cgi-bin/user/get ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **follower_count** (integer) - The total number of followers. #### Response Example ```json { "follower_count": 12345 } ``` ```