Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
antdv-next avatar

X Request

  • 5 installs
  • 71 repo stars
  • Updated August 4, 2026
  • antdv-next/x

x-request (antdv-next) is a Claude Code skill for configuring XRequest from @antdv-next/x-sdk, the tool that handles network requests, auth, retries, and streaming for Antdv Next X chat apps.

About

This skill explains how to configure XRequest from @antdv-next/x-sdk, the request tool that handles network communication, authentication, error handling, and streaming for Antdv Next X chat apps. A developer uses it to set up transport, auth headers, retries, and SSE or JSON streaming for a Vue chat interface. It includes a security guide on keeping API keys out of the browser and using proxy forwarding instead.

  • Configures XRequest for streaming chat transport, auth, and retries in Vue apps
  • Documents SSE and JSON streaming plus per-environment security guidance
  • Warns against configuring API keys in the browser frontend

X Request by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #1,790 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

x-request capabilities & compatibility

Capabilities
request config · streaming adapter · auth setup
Works with
openai
Use cases
frontend · api development
From the docs

What x-request says it does

This skill focuses on solving**: How to correctly configure XRequest to adapt to various streaming interface requirements.
SKILL.md
Browser Frontend** | 🔴 High Risk | ❌ Prohibit key configuration | Keys will be directly exposed to users
SKILL.md
npx skills add https://github.com/antdv-next/x --skill x-request

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars71
Last updatedAugust 4, 2026
Repositoryantdv-next/x

What it does

Configure XRequest transport, auth, and streaming for an Antdv Next X Vue chat app.

Who is it for?

Configuring transport, auth, retries, and streaming separators for an Antdv Next X chat app

Skip if: Managing chat state or rendering markdown, which other x-* skills cover

When should I use this skill?

You need to configure request transport, authentication, or streaming for Antdv Next X

What you get

A correctly configured XRequest instance with safe key handling

  • Configured XRequest instance

By the numbers

  • Requires @antdv-next/x-sdk version >= 2.2.2

Files

SKILL.mdMarkdownGitHub ↗

🎯 Skill Positioning

This skill focuses on solving: How to correctly configure XRequest to adapt to various streaming interface requirements.

Table of Contents

🚀 Quick Start

Dependency Management

📋 System Requirements

PackageVersion RequirementAuto InstallPurpose
@antdv-next/x-sdk≥2.2.2Core SDK, includes XRequest tool

🛠️ One-click Installation

# Recommended to use tnpm
tnpm install @antdv-next/x-sdk

# Or use npm
npm add @antdv-next/x-sdk

# Check version
npm ls @antdv-next/x-sdk

Basic Configuration

Simplest Usage

import { XRequest } from "@antdv-next/x-sdk";

// Minimal configuration: only need to provide API URL
const request = XRequest("https://api.example.com/chat");

// For manual control (used in Provider scenarios)
const providerRequest = XRequest("https://api.example.com/chat", {
  manual: true, // Usually only this needs explicit configuration
});
💡 Tip: XRequest has built-in reasonable default configurations. In most cases, you only need to provide the API URL to use it.

📦 Technology Stack Overview

🏗️ Technology Stack Architecture

graph TD
    A[XRequest] --> B[Network Requests]
    A --> C[Authentication Management]
    A --> D[Error Handling]
    A --> E[Streaming Processing]
    B --> F[fetch Wrapper]
    C --> G[Token Management]
    D --> H[Retry Mechanism]
    E --> I[Server-Sent Events]

🔑 Core Concepts

ConceptRole PositioningCore ResponsibilitiesUsage Scenarios
XRequest🌐 Request ToolHandle all network communication, authentication, error handlingUnified request management
Global Config⚙️ Config CenterConfigure once, use everywhereReduce duplicate code
Streaming Config🔄 Streaming ProcessingSupport SSE and JSON response formatsAI conversation scenarios

🔧 Core Configuration Details

Core functionality reference content CORE.md

🛡️ Security Guide

Environment Security Configuration

🌍 Security Strategies for Different Environments

Runtime EnvironmentSecurity LevelConfiguration MethodRisk Description
Browser Frontend🔴 High Risk❌ Prohibit key configurationKeys will be directly exposed to users
Node.js Backend🟢 Safe✅ Environment variable configurationKeys stored on server side
Proxy Service🟢 Safe✅ Same-origin proxy forwardingKeys managed by proxy service

🔐 Authentication Methods Comparison

Authentication MethodApplicable EnvironmentConfiguration ExampleSecurity
Bearer TokenNode.jsBearer ${process.env.API_KEY}✅ Safe
API Key HeaderNode.jsX-API-Key: ${process.env.KEY}✅ Safe
Proxy ForwardingBrowser/api/proxy/service✅ Safe
Direct ConfigurationBrowserBearer sk-xxx❌ Dangerous

🔍 Debugging and Testing

Debug Configuration

🛠️ Debug Templates

Node.js Debug Configuration:

// Safe debug configuration (Node.js environment)
const debugRequest = XRequest("https://your-api.com/chat", {
  headers: {
    Authorization: `Bearer ${process.env.DEBUG_API_KEY}`,
  },
  params: { query: "test message" },
});

Frontend Debug Configuration:

// Safe debug configuration (frontend environment)
const debugRequest = XRequest("/api/debug/chat", {
  params: { query: "test message" },
});

Configuration Validation

✅ Security Check Tools

// Security configuration validation function
const validateSecurity = (config: any) => {
  const isBrowser = typeof window !== "undefined";
  const hasAuth =
    config.headers?.Authorization || config.headers?.authorization;

  if (isBrowser && hasAuth) {
    throw new Error(
      "❌ Frontend environment prohibits Authorization configuration, risk of key leakage!",
    );
  }

  console.log("✅ Security configuration check passed");
  return true;
};

// Usage example
validateSecurity({
  headers: {
    // Do not include Authorization
  },
});

📋 Usage Scenarios

Standalone Usage

🎯 Direct Request Initiation

import { XRequest } from "@antdv-next/x-sdk";

// Test interface availability
const testRequest = XRequest("https://httpbin.org/post", {
  params: { test: "data" },
});

// Send request immediately
const response = await testRequest();
console.log(response);

Integration with Other Skills

🔄 Skill Collaboration Workflow

graph TD
    A[x-request] -->|Configure Request| B[x-chat-provider]
    A -->|Configure Request| C[use-x-chat]
    B -->|Provide Provider| C
    A --> D[Direct Request]
Usage MethodCooperating SkillPurposeExample
StandaloneNoneDirect network request initiationTest interface availability
With x-chat-providerx-chat-providerConfigure requests for custom ProviderConfigure private API
With use-x-chatuse-x-chatConfigure requests for built-in ProviderConfigure OpenAI API
Complete AI Applicationx-request → x-chat-provider → use-x-chatConfigure requests for entire systemComplete AI conversation application

⚠️ useXChat Integration Security Warning

Important Warning: useXChat is only for frontend environments, XRequest configuration must not contain Authorization!

❌ Incorrect Configuration (Dangerous):

// Extremely dangerous: keys will be directly exposed to browser
const unsafeRequest = XRequest("https://api.openai.com/v1/chat/completions", {
  headers: {
    Authorization: "Bearer sk-xxxxxxxxxxxxxx", // ❌ Dangerous!
  },
  manual: true,
});

✅ Correct Configuration (Safe):

// Frontend security configuration: use proxy service
const safeRequest = XRequest("/api/proxy/openai", {
  params: {
    model: "gpt-3.5-turbo",
    stream: true,
  },
  manual: true,
});

🚨 Development Rules

Test Case Rules

  • If the user does not explicitly need test cases, do not add test files
  • Only create test cases when the user explicitly requests them

Code Quality Rules

  • After completion, must check types: Run tsc --noEmit to ensure no type errors
  • Keep code clean: Remove all unused variables and imports

✅ Configuration Checklist

Before using XRequest, please confirm the following configurations are correctly set:

🔍 Configuration Checklist

Check ItemStatusDescription
API URL✅ Must ConfigureXRequest('https://api.xxx.com')
Auth Info⚠️ Environment RelatedFrontend❌Prohibited, Node.js✅Available
manual Config✅ Provider ScenarioIn Provider needs to be set to true, other scenarios need to be set according to actual situation
Other Config❌ No Need to ConfigureBuilt-in reasonable default values
Interface Availability✅ Recommended TestVerify with debug configuration

🛠️ Quick Verification Script

// Check configuration before running
const checkConfig = () => {
  const checks = [
    {
      name: "Global Configuration",
      test: () => {
        // Check if global configuration has been set
        return true; // Check according to actual situation
      },
    },
    {
      name: "Security Configuration",
      test: () => validateSecurity(globalConfig),
    },
    {
      name: "Type Check",
      test: () => {
        // Run tsc --noEmit
        return true;
      },
    },
  ];

  checks.forEach(check => {
    console.log(`${check.name}: ${check.test() ? "✅" : "❌"}`);
  });
};

🎯 Skill Collaboration

graph LR
    A[x-request] -->|Configure Request| B[x-chat-provider]
    A -->|Configure Request| C[use-x-chat]
    B -->|Provide Provider| C

📊 Skill Usage Comparison Table

Usage ScenarioRequired SkillsUsage OrderCompletion Time
Test Interfacex-requestDirect Use2 minutes
Private API Adaptationx-request → x-chat-providerConfigure request first, then create Provider10 minutes
Standard AI Applicationx-request → use-x-chatConfigure request first, then build interface15 minutes
Complete Customizationx-request → x-chat-provider → use-x-chatComplete workflow30 minutes

🔗 Reference Resources

📚 Core Reference Documentation

  • API.md - Complete API reference documentation
  • EXAMPLES_SERVICE_PROVIDER.md - Configuration examples for various service providers

🌐 SDK Official Documentation

💻 Example Code

Related skills

FAQ

Can I put an API key in the browser frontend?

No; the docs mark browser frontend key configuration as high risk because keys are exposed to users. Use Node.js environment variables or same-origin proxy forwarding instead.

What is the minimal XRequest configuration?

In most cases you only need to provide the API URL, since XRequest has built-in reasonable defaults; add manual: true for Provider scenarios.

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.