• Product Introduction
  • Quick Start
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
    • Start with AI
  • Framework Guide
    • Frontends
    • Backends
    • Full-stack
      • Next.js
      • Nuxt
      • Astro
      • React Router
      • SvelteKit
    • Custom 404 Page
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Using Github Actions
    • Using CNB Plugin
    • Using IDE PlugIn
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • HTTPS Configuration
      • Overview
      • Apply for Free Certificate
      • Using Managed SSL Certificate
    • Configure DNS CNAME Record
  • Observability
    • Overview
    • Metric Analysis
    • Log Analysis
  • Pages Functions
    • Overview
    • Edge Functions
    • Cloud Functions
      • Overview
      • Node Functions
  • KV Storage
  • Edge AI
  • API Token
  • EdgeOne CLI
  • Pages MCP
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • Using General Large Model to Quickly Build AI Application
    • Use the DeepSeek model to quickly build a conversational AI site
    • Building an Ecommerce Platform with Shopify
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Pages
    • Migrating from Cloudflare Pages to EdgeOne Pages
    • Migrating from Netlify to EdgeOne Pages
  • Troubleshooting
  • FAQs
  • Contact Us
  • Release Notes

Pages KV Integration

Pages KV storage is a powerful distributed Key-Value storage system provided by EdgeOne.


Overview

KV storage is applicable to dynamic feature enhancement for static websites, lightweight data storage, serverless application support, and data caching. Compared with traditional databases, it is more suitable for read-heavy scenarios as a lightweight storage solution.


Getting Started

If it is your first-time use of Pages KV storage service, we recommend using the template we provide to try. The overall operation steps include three steps: enable the KV storage service, associate the Pages project with the KV space, and use KV storage in the project. The following introduces the related content in detail.


Enabling Pages KV Service

Enter the Pages console, click KV Storage in the header navigation bar, then click Apply now to start enabling.

To enable the KV storage service, complete the following steps:

1. Fill in application reasons - Describe the usage scenario and target based on your actual business need.
2. Submit application - After completing the application form, click the Submit button to officially submit for review.
3. Wait for approval - The system will notify related staff to evaluate and handle it.

If you have urgent development needs, you can contact the manager to handle it.


4. Create Namespace
Service activated, click the Create Namespace option in the console.
Assign a name with business significance to the namespace
Click to confirm completion of creation

5. Initialize KV storage
Navigate to the Data Management section
Click Create Record to start configuration of key-value pair data
Set the key name (Key) and value (Value) based on business requirements
Complete all required fields and submit

Note: After KV storage initialization is completed, data read and write operations can be performed via API. It is advisable to plan the key name naming specification and data storage structure in advance.


Creating a Pages Project and Associating KV Storage

1. Deploying a Pages KV Template

On the console Pages Project webpage, click Create project -> Start from template. In the left sidebar, find Database -> Pages KV, select
Pages functions for KV Template

Open the template, click Create on the deployment page. Deployment usually takes about 20 seconds. Before deployment, if not associated with an online Git, you need to complete Git authorization (supports Github/Gitee).


2. Bind a Namespace to Pages Project

After deployment, click KV Storage in the left navigation bar, then click Bind Namespace on the page.

In the Bind Namespace window, select the Namespace created in the KV service applied for earlier, then fill in Variable Name. Variable Name will be used in code to access variables in the Namespace.


3. Implementing KV Operations in Code

For specific use, check the template code in Pages functions for KV, specifically /functions/visit/index.js. The following is a simple access request example.
// Get variable
const visitCount = await my_kv.get('visitCount');
let visitCountInt = Number(visitCount);
visitCountInt += 1;

// Modify variable
await my_kv.put('visitCount', visitCountInt.toString());

const res = JSON.stringify({
visitCount: visitCountInt,
});
For more detailed info, visit the operation document.


Local Development

EdgeOne CLI provides developers with a powerful command line interface tool that can significantly improve your development efficiency and code quality. With this tool, you can:

Perform edge computing operations intuitively and simplify the configuration process
Efficiently debug code: detect and optimize code performance in real time in the local environment
Online data sync: easily import production environment data to the local development environment for true and reliable testing
Precise problem localization: quickly identify and address performance bottlenecks in edge computing

Whether you are an experienced developer or a beginner just exposed to edge computing, EdgeOne CLI can help you build more stable and efficient applications. For more information on advanced functions and best practices, please visit our operation documentation.


More Related Content

Learn about EdgeOne CLI usage: EdgeOne CLI instructions
Learn about KV Storage: KV Storage operation instructions
Learn more about edge function usage: Edge function operation instructions

ai-agent
私に尋ねることができます、例えば
EdgeOne Pagesの使用を開始するには?