Viewing API Keys
Scenarios
You can view and manage API keys for your Supabase AI application to call Supabase features through APIs. For details about related API documentation, see Management API.
Prerequisites
- You have registered a Huawei ID and enabled Huawei Cloud services.
- You can create an IAM user and user group on the IAM console and grant the user specific operation permissions, to perform refined management on Huawei Cloud. For details, see Using IAM Roles or Policies to Grant Access to RDS.
- You must use a login account assigned the rds:aiApplication:listApiKey, rds:aiApplication:getApiKeyValue, rds:aiApplication:restart, and rds:aiApplication:list actions.
API Key Usage Guide
- Description
API keys containing publishable in their names correspond to public credentials. They grant anonymous user permissions (restricted by RLS) and are safe to expose in client-side code, such as browser pages and mobile apps.
- How to Obtain
Log in to the console and navigate to the API Key page. Locate the row containing publishable in the name and click Copy API Key Value in the Operation column to obtain the current API key value.
- Usage Method
For details about using API keys on clients, see API References. The procedure is as follows:
- Install @supabase/supabase-js using the command line.
npm install @supabase/supabase-js
- Import the library and establish a database connection.
import { createClient } from'@supabase/supabase-js' // Create a single supabase client for interacting with your database const supabase =createClient('your-supabase-address', 'your-api-key')
Keep your API keys secure to prevent security risks, potential attacks, and business losses.
- Install @supabase/supabase-js using the command line.
Constraints
- An AI application is created.
- The Supabase AI application currently supports only one active API key at a time. Each newly created key invalidates the previous one.
Procedure
- Log in to the RDS console.
- Click
in the upper left corner and select a region. - In the navigation pane, choose AI App Dev Platform.
- On the AI App Dev Platform page, click the target AI application name to open its details page.
- In the navigation pane, choose API Key. The API key list is displayed. Figure 1 Application API key list
- Locate an API key whose status is Normal and click Copy API Key Value in the Operation column to copy the key value to the clipboard.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot