### D1 Getting Started Source: https://developers.cloudflare.com/llms.txt A guide to help new users get started with Cloudflare D1. This covers the initial setup, basic configuration, and first steps to using D1. ```APIDOC Getting started: Getting started ``` -------------------------------- ### Testing Workers with Miniflare: Get Started Source: https://developers.cloudflare.com/llms.txt A guide to getting started with Miniflare for testing Cloudflare Workers. This section provides initial steps and setup instructions for local development and testing environments. ```Markdown Get Started ``` -------------------------------- ### Cloudflare Containers: Getting Started and Configuration Source: https://developers.cloudflare.com/llms.txt Guides for getting started with Cloudflare Containers, including Wrangler commands and configuration options. ```APIDOC Containers: Getting Started: Initial steps to begin using Cloudflare Containers. Wrangler Commands: Commands available through the Wrangler CLI for managing containers. Wrangler Configuration: Configuring your container deployments using Wrangler. ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/managed-components/demo Instructions for setting up the local development environment for the Cloudflare Zaraz LLMs demo. This includes installing dependencies and running tests. ```bash npm i npm run test:dev ``` -------------------------------- ### Realtime SFU Overview and Operations Source: https://developers.cloudflare.com/llms.txt Covers the Realtime SFU quickstart guide, example architecture, limits, pricing, and changelog. ```APIDOC Realtime SFU: - Quickstart guide: https://developers.cloudflare.com/realtime/sfu/get-started/index.md - Example architecture: https://developers.cloudflare.com/realtime/sfu/example-architecture/index.md - Limits, timeouts and quotas: https://developers.cloudflare.com/realtime/sfu/limits/index.md - Pricing: https://developers.cloudflare.com/realtime/sfu/pricing/index.md - Changelog: https://developers.cloudflare.com/realtime/sfu/changelog/index.md - Introduction: https://developers.cloudflare.com/realtime/sfu/introduction/index.md ``` -------------------------------- ### Cloudflare Vectorize Get Started and Tutorials Source: https://developers.cloudflare.com/llms.txt Getting started guides and tutorials for Cloudflare Vectorize, covering introduction, embeddings, and Wrangler commands. ```APIDOC Vectorize Get Started & Tutorials: - Get Started: Initial steps to begin using Vectorize. - Introduction to Vectorize: Overview of what Vectorize is. - Embeddings: How to generate and use embeddings with Vectorize. - Tutorials: Step-by-step guides for various use cases. - Wrangler Commands: Using Wrangler CLI for Vectorize operations. ``` -------------------------------- ### RealtimeKit Overview Source: https://developers.cloudflare.com/llms.txt Documentation for RealtimeKit, covering concepts, getting started guides, and general introduction to the service. ```APIDOC RealtimeKit: - Concepts: https://developers.cloudflare.com/realtime/realtimekit/concepts/index.md - Getting Started: https://developers.cloudflare.com/realtime/realtimekit/getting-started/index.md - Introduction: https://developers.cloudflare.com/realtime/realtimekit/introduction/index.md ``` -------------------------------- ### Cloudflare AutoRAG How-To Guides Source: https://developers.cloudflare.com/llms.txt Provides practical instructions and examples for implementing specific functionalities with Cloudflare AutoRAG. Includes guides on creating search engines, managing multitenancy, and integrating custom models. ```APIDOC How-To Guides: - Bring Your Own Generation Model: Instructions for integrating custom LLMs. - Create Multitenancy: Steps to set up multi-tenant RAG applications. - Create a Simple Search Engine: A guide to building a basic search functionality using AutoRAG. - Tutorials: Step-by-step walkthroughs for common use cases, such as building a RAG from a website. ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/managed-components/demo Instructions for installing project dependencies using npm and running unit tests in development mode. ```bash npm i npm run test:dev ``` -------------------------------- ### Cloudflare Workers CI/CD Setup Source: https://developers.cloudflare.com/llms.txt Guides on setting up continuous integration and continuous deployment for Cloudflare Workers projects. ```APIDOC CI/CD: description: Set up continuous integration and continuous deployment for your Workers. url: https://developers.cloudflare.com/workers/ci-cd/index.md ``` -------------------------------- ### Cloudflare Stream Live Stream with OBS Source: https://developers.cloudflare.com/llms.txt Guide on setting up and starting a live stream using OBS (Open Broadcaster Software) Studio with Cloudflare Stream. ```APIDOC Live Stream with OBS: - First Live Stream with OBS: Step-by-step guide to configure OBS Studio for Cloudflare Stream and start broadcasting. ``` -------------------------------- ### Cloudflare Workers Framework Guides Source: https://developers.cloudflare.com/llms.txt Guides for creating full-stack applications deployed to Cloudflare Workers using various frameworks. ```APIDOC Framework Guides: description: Create full-stack applications deployed to Cloudflare Workers. url: https://developers.cloudflare.com/workers/framework-guides/index.md ``` -------------------------------- ### Cloudflare Workers Analytics Engine Overview Source: https://developers.cloudflare.com/analytics/graphql-api/getting-started/authentication/api-token-auth/ Introduction to the Workers Analytics Engine (WAE), including getting started, SQL API, and querying capabilities. ```APIDOC Workers Analytics Engine Overview: /analytics/analytics-engine/ Get started with WAE: /analytics/analytics-engine/get-started/ SQL API for WAE: /analytics/analytics-engine/sql-api/ SQL Reference for WAE: /analytics/analytics-engine/sql-reference/ Querying WAE from Grafana: /analytics/analytics-engine/grafana/ Querying WAE from a Worker: /analytics/analytics-engine/worker-querying/ Sampling with WAE: /analytics/analytics-engine/sampling/ WAE Pricing: /analytics/analytics-engine/pricing/ WAE Limits: /analytics/analytics-engine/limits/ ``` -------------------------------- ### Vitest Workers Integration Recipes and Examples Source: https://developers.cloudflare.com/llms.txt A collection of recipes and examples demonstrating how to write unit and integration tests for Cloudflare Workers using the Vitest integration. These examples showcase best practices and common testing scenarios. ```Markdown Recipes and examples: Examples that demonstrate how to write unit and integration tests with the Workers Vitest integration. ``` -------------------------------- ### Deploy SvelteKit to Cloudflare Pages Source: https://developers.cloudflare.com/llms.txt Learn how to create and deploy a SvelteKit application to Cloudflare Pages using the create-cloudflare CLI. This guide covers the setup process and deployment best practices. ```English Use C3 (`create-cloudflare` CLI) to set up and deploy new applications using framework-specific setup guides to ensure each new application follows Cloudflare and any third-party best practices for deployment. ``` -------------------------------- ### Build a Todo List Jamstack Application with Workers Source: https://developers.cloudflare.com/llms.txt Tutorial on building a Jamstack application featuring a todo list, utilizing Cloudflare Workers. This guide covers the development process from start to finish. ```Markdown Build a todo list Jamstack application ``` -------------------------------- ### D1 Examples Source: https://developers.cloudflare.com/llms.txt A repository of examples demonstrating different ways to use Cloudflare D1. These examples cover various functionalities and integration scenarios. ```APIDOC Examples: Examples ``` -------------------------------- ### Transform Examples Source: https://developers.cloudflare.com/rules/configuration-rules/ A collection of examples demonstrating various transformations in Cloudflare Zaraz, such as adding/removing headers, rewriting URLs, and normalizing paths. ```APIDOC rules/transform/examples/add-request-header-subrequest-other-zone/ ``` ```APIDOC rules/transform/examples/add-request-header-bot-score/ ``` ```APIDOC rules/transform/examples/add-response-header-static-value/ ``` ```APIDOC rules/transform/examples/add-request-header-static-value/ ``` ```APIDOC rules/transform/examples/normalize-encoded-slash/ ``` ```APIDOC rules/transform/examples/remove-request-header/ ``` ```APIDOC rules/transform/examples/remove-response-header/ ``` ```APIDOC rules/transform/examples/rewrite-archive-urls-new-format/ ``` ```APIDOC rules/transform/examples/rewrite-several-url-different-url/ ``` ```APIDOC rules/transform/examples/rewrite-welcome-for-countries/ ``` ```APIDOC rules/transform/examples/rewrite-path-object-storage/ ``` ```APIDOC rules/transform/examples/rewrite-path-archived-posts/ ``` ```APIDOC rules/transform/examples/rewrite-moved-section/ ``` ```APIDOC rules/transform/examples/rewrite-url-string-visitors/ ``` ```APIDOC rules/transform/examples/set-response-header-bot-score/ ``` ```APIDOC rules/transform/examples/set-response-header-static-value/ ``` -------------------------------- ### Framework Guides for Cloudflare Workers Source: https://developers.cloudflare.com/llms.txt Guides for creating and deploying web applications using various frameworks on Cloudflare Workers with Workers Assets. ```APIDOC React + Vite: https://developers.cloudflare.com/workers/framework-guides/web-apps/react/index.md RedwoodSDK: https://developers.cloudflare.com/workers/framework-guides/web-apps/redwoodsdk/index.md Svelte: https://developers.cloudflare.com/workers/framework-guides/web-apps/svelte/index.md TanStack: https://developers.cloudflare.com/workers/framework-guides/web-apps/tanstack/index.md Vue: https://developers.cloudflare.com/workers/framework-guides/web-apps/vue/index.md ``` -------------------------------- ### Example Custom Endpoint Pathname Source: https://context7_llms Provides an example of a custom pathname for hosting Zaraz's initialization script. ```APIDOC /my-server/my-scripts/start.js ``` -------------------------------- ### Cloudflare Containers Examples: Websocket Forwarding Source: https://developers.cloudflare.com/llms.txt An example demonstrating how to forward Websocket requests to a Cloudflare Container. ```APIDOC Containers Examples: Websocket to Container: Forwarding a Websocket request to a Container. ``` -------------------------------- ### Scaffold and Build a Managed Component Source: https://managedcomponents.dev/getting-started/quickstart This snippet shows the essential commands to initialize a new managed component project, write its logic, and build it for deployment. It utilizes npm for package management and assumes a standard project structure. ```bash npm init managed-component ``` ```typescript export default async function (manager, settings) { // the Managed Component logic goes here } ``` ```bash npm install npm run build ``` -------------------------------- ### Workers Analytics Engine Overview Source: https://developers.cloudflare.com/llms.txt Provides an overview of the Workers Analytics Engine, including getting started guides, querying from Grafana and Workers, pricing, sampling, and SQL API references. ```APIDOC Workers Analytics Engine: - Get started: https://developers.cloudflare.com/analytics/analytics-engine/get-started/index.md - Querying from Grafana: https://developers.cloudflare.com/analytics/analytics-engine/grafana/index.md - Querying from a Worker: https://developers.cloudflare.com/analytics/analytics-engine/worker-querying/index.md - SQL API: https://developers.cloudflare.com/analytics/analytics-engine/sql-api/index.md - SQL Reference: https://developers.cloudflare.com/analytics/analytics-engine/sql-reference/index.md - Pricing: https://developers.cloudflare.com/analytics/analytics-engine/pricing/index.md (Based on data points written and read queries) - Sampling: https://developers.cloudflare.com/analytics/analytics-engine/sampling/index.md (Automatic data sampling at scale) - Examples: https://developers.cloudflare.com/analytics/analytics-engine/recipes/index.md - Usage-based billing: https://developers.cloudflare.com/analytics/analytics-engine/recipes/usage-based-billing-for-your-saas-product/index.md ``` -------------------------------- ### Install Private Packages in Cloudflare Pages Source: https://developers.cloudflare.com/llms.txt Learn how to install private npm packages in your Cloudflare Pages projects. This guide covers using private npm registries. ```English Install private packages ``` -------------------------------- ### Zaraz Setup and Troubleshooting Source: https://developers.cloudflare.com/zaraz/faq/ Guidance on verifying Zaraz script loading, common issues, and compatibility with other Cloudflare features like Rocket Loader and CSP. ```APIDOC Zaraz Setup and Troubleshooting: Verifying Zaraz Script Loading: 1. Open your website in a web browser. 2. Open your browser's Developer Tools. 3. In the Console, type `zaraz`. 4. If you see an error message saying `zaraz is not defined`, Zaraz failed to load. Common Loading Issues: - Domain not proxied by Cloudflare. - Auto Injection disabled in Zaraz Settings. - Invalid HTML structure (missing `
` tags). - No enabled tools configured in Zaraz. Browser Extension Compatibility: - Zaraz tools run server-side, so browser extensions cannot detect them. Data Discrepancies: - Use Zaraz Monitoring and Debug Mode to identify workflow issues. Rocket Loader Compatibility: - Recommended to disable Rocket Loader when using Zaraz. - Rocket Loader can delay data, causing potential issues. Content Security Policies (CSP): - Zaraz is compatible with CSP configurations. - Refer to the Cloudflare blog post "Cloudflare Zaraz supports CSP" for details. ``` -------------------------------- ### Cloudflare Pub/Sub Client Examples Source: https://developers.cloudflare.com/llms.txt Examples demonstrating how to connect to Cloudflare Pub/Sub brokers using different programming languages. Includes Python, JavaScript (Node.js), and Rust, utilizing MQTT client libraries and token authentication. ```Python Connect to a Broker using Python 3 ``` ```JavaScript Use MQTT.js with the token authentication mode configured on a broker. ``` ```Rust Connect to a Broker using a Rust-based MQTT client. ``` -------------------------------- ### Cloudflare Workers Dashboard Source: https://developers.cloudflare.com/llms.txt Information on how to get started with Cloudflare Workers using the dashboard. ```APIDOC Dashboard: description: Get started with Cloudflare Workers using the dashboard. url: https://developers.cloudflare.com/workers/get-started/dashboard/index.md ``` -------------------------------- ### Connect to PostgreSQL Databases with Hyperdrive Source: https://developers.cloudflare.com/llms.txt Guides and examples for connecting Cloudflare Hyperdrive to various PostgreSQL database providers. ```English Connecting to PostgreSQL Databases: - AWS RDS and Aurora: Connect Hyperdrive to an AWS RDS or Aurora Postgres database instance. - Azure Database for PostgreSQL: Connect Hyperdrive to a Azure Database for PostgreSQL instance. ``` -------------------------------- ### Zaraz Setup: Cloudflare Proxy Recommendation Source: https://context7_llms This documentation explains the initial setup for Zaraz, recommending that websites be proxied through Cloudflare for optimal performance and functionality. It provides links for setting up Cloudflare and for users who do not wish to proxy their domain through Cloudflare. ```APIDOC Get Started with Zaraz: Prerequisites: - It is recommended to proxy your website through Cloudflare. - Refer to: [Set up Cloudflare](https://developers.cloudflare.com/fundamentals/account/) Alternative Setup: - If you do not want to proxy your website through Cloudflare: - Refer to: [Use Zaraz on domains not proxied by Cloudflare](https://developers.cloudflare.com/zaraz/advanced/domains-not-proxied/) ``` -------------------------------- ### Cloudflare Developer Spotlight Tutorials Index Source: https://developers.cloudflare.com/llms.txt An index page listing all available tutorials under the Cloudflare Developer Spotlight program. ```APIDOC Index: Tutorials Link: https://developers.cloudflare.com/developer-spotlight/tutorials/index.md ``` -------------------------------- ### D1 Tutorials Source: https://developers.cloudflare.com/llms.txt Step-by-step tutorials for learning and using Cloudflare D1. These guides provide practical instructions for common tasks and advanced features. ```APIDOC Tutorials: Tutorials ``` -------------------------------- ### Cloudflare Workers Wrangler Source: https://developers.cloudflare.com/llms.txt Documentation for Wrangler, the command-line tool for Cloudflare Workers, covering installation, commands, configuration, and advanced setups. ```Markdown - [Bundling](https://developers.cloudflare.com/workers/wrangler/bundling/index.md): Review Wrangler's default bundling. - [API](https://developers.cloudflare.com/workers/wrangler/api/index.md): A set of programmatic APIs that can be integrated with local Cloudflare Workers-related workflows. - [Commands](https://developers.cloudflare.com/workers/wrangler/commands/index.md): Create, develop, and deploy your Cloudflare Workers with Wrangler commands. - [Configuration](https://developers.cloudflare.com/workers/wrangler/configuration/index.md): Use a configuration file to customize the development and deployment setup for your Worker project and other Developer Platform products. - [Custom builds](https://developers.cloudflare.com/workers/wrangler/custom-builds/index.md): Customize how your code is compiled, before being processed by Wrangler. - [Deprecations](https://developers.cloudflare.com/workers/wrangler/deprecations/index.md): The differences between Wrangler versions, specifically deprecations and breaking changes. - [Environments](https://developers.cloudflare.com/workers/wrangler/environments/index.md): Use environments to create different configurations for the same Worker application. - [Wrangler](https://developers.cloudflare.com/workers/wrangler/index.md) - [Install/Update Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/index.md): Get started by installing Wrangler, and update to newer versions by following this guide. - [System environment variables](https://developers.cloudflare.com/workers/wrangler/system-environment-variables/index.md): Local environment variables that can change Wrangler's behavior. ``` -------------------------------- ### Cloudflare GraphQL API Tutorials Source: https://developers.cloudflare.com/analytics/graphql-api/getting-started/authentication/api-token-auth/ Tutorials demonstrating practical uses of the GraphQL API, such as creating widgets, capturing queries, and analyzing various event types. ```APIDOC Use GraphQL to create widgets: /analytics/graphql-api/tutorials/use-graphql-create-widgets/ Capture GraphQL queries with Chrome DevTools: /analytics/graphql-api/tutorials/capture-graphql-queries-from-dashboard/ Querying Access login events: /analytics/graphql-api/tutorials/querying-access-login-events/ Querying Firewall Events: /analytics/graphql-api/tutorials/querying-firewall-events/ Querying HTTP events by hostname: /analytics/graphql-api/tutorials/end-customer-analytics/ Querying Magic Firewall IDS samples: /analytics/graphql-api/tutorials/querying-magic-firewall-ids-samples/ Querying Magic Firewall Samples: /analytics/graphql-api/tutorials/querying-magic-firewall-samples/ Querying Magic Transit and Magic WAN tunnel bandwidth analytics: /analytics/graphql-api/tutorials/querying-magic-transit-tunnel-bandwidth-analytics/ Querying Magic Transit and Magic WAN tunnel health check results: /analytics/graphql-api/tutorials/querying-magic-transit-tunnel-healthcheck-results/ Querying Workers Metrics: /analytics/graphql-api/tutorials/querying-workers-metrics/ ``` -------------------------------- ### Create Zaraz Trigger Source: https://context7_llms A guide to creating triggers in Zaraz, which define the conditions under which a tool's action will start. Triggers are composed of one or more rules. ```Markdown 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain. 2. Go to **Zaraz** > **Tools Configuration**. 3. Select the **Triggers** tab. 4. Select **Create trigger**. 5. In **Trigger Name** enter a descriptive name for your trigger. 6. In **Rule type**, choose from the actions available in the drop-down menu to start building your rule. Refer to [Triggers and rules](https://developers.cloudflare.com/zaraz/reference/triggers/) for more information on what each rule type means. 7. In **Variable name**, input the variable you want as the trigger. For example, use *Event Name* if you are using [`zaraz.track()`](https://developers.cloudflare.com/zaraz/web-api/track/) in your website. If you want to use a variable you have previously [created in Variables](https://developers.cloudflare.com/zaraz/variables/create-variables/), select the `+` sign in the drop-down menu, scroll to **Variables**, and choose your variable. 8. Use the **Match operation** drop-down list to choose a comparison operator. For an expression to match, the value in **Variable name** and **Match string** must satisfy the comparison operator. 9. In **Match string**, input the string that completes the rule. ``` -------------------------------- ### Cloudflare Workers Languages Source: https://developers.cloudflare.com/workers/runtime-apis/request/ Information on supported languages for Cloudflare Workers, including JavaScript, TypeScript, Python, and Rust, with examples and specific guides. ```APIDOC Languages: - Overview: /workers/languages/ JavaScript: - Overview: /workers/languages/javascript/ - Examples: /workers/examples/?languages=JavaScript TypeScript: - Overview: /workers/languages/typescript/ - Examples: /workers/examples/?languages=TypeScript Python: - Overview Beta: /workers/languages/python/ - How Python Workers Work: /workers/languages/python/how-python-workers-work/ - Standard Library: /workers/languages/python/stdlib/ - Examples: /workers/languages/python/examples/ - Foreign Function Interface (FFI): /workers/languages/python/ffi/ - Packages: - Overview: /workers/languages/python/packages/ - FastAPI: /workers/languages/python/packages/fastapi/ - Langchain: /workers/languages/python/packages/langchain/ Rust: - Overview Beta: /workers/languages/rust/ - Supported crates: /workers/languages/rust/crates/ ``` -------------------------------- ### Cloudflare Containers Examples: Backend and Cron Source: https://developers.cloudflare.com/llms.txt Examples demonstrating Cloudflare Containers, including a static frontend with a containerized backend and running containers with Cron Triggers. ```APIDOC Containers Examples: Static Frontend, Container Backend: Deploying a frontend app with a containerized backend. Cron Container: Scheduling container execution using Cron Triggers. ``` -------------------------------- ### Cloudflare Workers Languages Source: https://developers.cloudflare.com/workers/get-started/guide/ Information on supported languages for Cloudflare Workers, including JavaScript, TypeScript, Python, and Rust, with examples and specific guides. ```APIDOC Languages: - Overview: /workers/languages/ JavaScript: - Overview: /workers/languages/javascript/ - Examples: /workers/examples/?languages=JavaScript TypeScript: - Overview: /workers/languages/typescript/ - Examples: /workers/examples/?languages=TypeScript Python: - Overview Beta: /workers/languages/python/ - How Python Workers Work: /workers/languages/python/how-python-workers-work/ - Standard Library: /workers/languages/python/stdlib/ - Examples: /workers/languages/python/examples/ - Foreign Function Interface (FFI): /workers/languages/python/ffi/ - Packages: - Overview: /workers/languages/python/packages/ - FastAPI: /workers/languages/python/packages/fastapi/ - Langchain: /workers/languages/python/packages/langchain/ Rust: - Overview Beta: /workers/languages/rust/ - Supported crates: /workers/languages/rust/crates/ ``` -------------------------------- ### Connect to MySQL Databases with Hyperdrive Source: https://developers.cloudflare.com/llms.txt Guides and examples for connecting Cloudflare Hyperdrive to various MySQL database providers and utilizing different MySQL drivers and libraries. ```English Connecting to MySQL Databases: - Azure Database for PostgreSQL: Connect Hyperdrive to an Azure Database for PostgreSQL instance. - AWS RDS and Aurora: Connect Hyperdrive to an AWS RDS database instance. - Google Cloud SQL: Connect Hyperdrive to a Google Cloud SQL database instance. - PlanetScale: Connect Hyperdrive to a PlanetScale MySQL database. Libraries and Drivers: - Drizzle ORM: Usage examples with Drizzle ORM. - mysql: Information on using the 'mysql' driver. - mysql2: Information on using the 'mysql2' driver. ``` -------------------------------- ### README and License Information Source: https://github.com/managed-components/demo Core documentation and licensing details for the project. The README provides an overview, and the LICENSE file specifies the terms of use. ```markdown README.md LICENSE ``` -------------------------------- ### Cloudflare Containers Examples: Stateless Instances and Status Hooks Source: https://developers.cloudflare.com/llms.txt Examples for Cloudflare Containers, including running stateless instances and reacting to status changes with status hooks. ```APIDOC Containers Examples: Stateless Instances: Running multiple stateless container instances across Cloudflare's network. Status Hooks: Executing Workers code in response to Container status changes. ``` -------------------------------- ### Example HTML Structure with Zaraz Script Source: https://developers.cloudflare.com/zaraz/advanced/load-zaraz-manually/ An example of a basic HTML page structure demonstrating the correct placement of the Zaraz script within the `` section. ```html .... … ``` -------------------------------- ### Enable Web Analytics in Cloudflare Pages Source: https://developers.cloudflare.com/llms.txt Instructions on enabling Web Analytics for your Cloudflare Pages site. This guide covers the setup and benefits of using Web Analytics. ```English Enable Web Analytics ``` -------------------------------- ### Build a Comments API with D1 Source: https://developers.cloudflare.com/llms.txt A tutorial on building a Comments API using Cloudflare D1. This example guides developers through creating a functional API that interacts with a D1 database. ```APIDOC Build a Comments API: Build a Comments API ``` -------------------------------- ### Building a Blog with Nuxt.js and Sanity.io on Cloudflare Pages Source: https://developers.cloudflare.com/llms.txt A tutorial on creating a blog application using Nuxt.js for the frontend and Sanity.io as a headless CMS, deployed on Cloudflare Pages. Covers setup, content modeling, and deployment. ```APIDOC Tutorial: Nuxt.js Blog with Sanity.io on Cloudflare Pages Purpose: Build and deploy a blog using Nuxt.js and Sanity.io. Overview: This tutorial guides you through setting up a Nuxt.js project, integrating Sanity.io for content management, and deploying the resulting blog to Cloudflare Pages. Part 1: Sanity.io Setup 1. **Create Sanity Project**: ```bash npm create sanity@latest my-sanity-blog cd my-sanity-blog npm run dev ``` Follow the prompts to set up your project (e.g., choose 'Blog' template). 2. **Define Schema**: - Edit `schemas/schema.js` and define your content types (e.g., `post`, `author`, `category`). - Example `schemas/post.js`: ```javascript export default { name: 'post', type: 'document', title: 'Blog Post', fields: [ { name: 'title', type: 'string', title: 'Title' }, { name: 'slug', type: 'slug', options: { source: 'title' } }, { name: 'body', type: 'array', of: [{ type: 'block' }] }, { name: 'publishedAt', type: 'datetime', title: 'Published At' }, // Add other fields like author, categories, featured image etc. ] } ``` 3. **Deploy Sanity Studio**: ```bash sanity deploy ``` This deploys your content studio to `*.sanity.studio`. Part 2: Nuxt.js Project Setup 1. **Create Nuxt.js Project**: ```bash npx nuxi init nuxt-sanity-blog cd nuxt-sanity-blog ``` 2. **Install Dependencies**: ```bash npm install @sanity/client @nuxtjs/sanity @nuxtjs/tailwindcss # or yarn add @sanity/client @nuxtjs/sanity @nuxtjs/tailwindcss ``` 3. **Configure Nuxt**: - Add `@nuxtjs/sanity` and `@nuxtjs/tailwindcss` to `nuxt.config.js`. - Configure Sanity client: ```javascript // nuxt.config.js export default defineNuxtConfig({ modules: [ '@nuxtjs/sanity', '@nuxtjs/tailwindcss' ], sanity: { projectId: 'YOUR_PROJECT_ID', // Get from Sanity dashboard dataset: 'production', // Or your dataset name useCdn: true, // Set to false for development if needed apiVersion: '2021-10-21' // Use current API version }, // ... other configurations }) ``` 4. **Fetch Data**: - Create API routes or use composables to fetch data from Sanity. - Example using Sanity module: ```vue