vtex-io-client-integration

Standardize VTEX IO backend service calls through registered @vtex clients.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/exilonX/ap2 --skill vtex-io-client-integration-exilonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vtex-io-client-integration
Source: https://github.com/exilonX/ap2/tree/main/.agents/skills/vtex-io-client-integration
Command: npx skills add https://github.com/exilonX/ap2 --skill vtex-io-client-integration-exilonx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents brittle VTEX IO backend integrations by standardizing how services and external APIs are called through @vtex/api and @vtex/clients, so authentication, retries, timeouts, and observability work consistently.

Core Features & Use Cases

  • Client selection & boundaries: Choose the narrowest appropriate client type (native @vtex/clients, JanusClient for Core Commerce via Janus, or ExternalClient for non-VTEX external APIs).
  • Correct registration & consumption: Register clients in a Clients class extending IOClients and consume them through ctx.clients (not direct instantiation in handlers).
  • InstanceOptions & reliability tuning: Configure shared and per-client options such as retries, request timeouts, headers, caching, and request metrics at the client layer.
  • Error normalization near the boundary: Normalize and surface meaningful failures close to the client boundary without hiding critical HTTP/transport details.

Quick Start

Use this skill to design or review your VTEX IO backend so all service-to-service HTTP calls go through registered @vtex clients and are accessed via ctx.clients rather than raw HTTP libraries or ad hoc client construction.

Frequently Asked Questions about vtex-io-client-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize VTEX IO client integrations for consistent auth and retries?

You standardize VTEX IO client integrations by implementing Node clients with @vtex/api and @vtex/clients, registering them in an IOClients class, and consuming them via ctx.clients to ensure consistent auth, retries, and observability across all service calls.

What is the correct way to register and consume VTEX IO clients in backend apps?

The correct way to register and consume VTEX IO clients is to define a Clients class extending IOClients, register your client implementations there, and access them through ctx.clients inside middlewares and resolvers rather than instantiating them directly in handlers.

When should I use JanusClient versus ExternalClient in VTEX IO?

Use JanusClient in VTEX IO when calling Core Commerce APIs via Janus, and use ExternalClient for non-VTEX external APIs. Selecting the narrowest appropriate client abstraction ensures correct routing and authentication for each service boundary.

Can I use raw HTTP libraries instead of @vtex/clients in VTEX IO apps?

No, you cannot use raw HTTP libraries in VTEX IO apps. The architecture enforces constraints that forbid raw HTTP libraries and require client registry usage to maintain consistent transport, authentication, retries, and observability at the client boundary.

How do I configure retries and timeouts for VTEX IO Node clients?

Configure retries and timeouts for VTEX IO Node clients by adjusting shared and per-client InstanceOptions. These options also let you tune headers, caching, and request metrics directly at the client boundary for reliable service-to-service HTTP calls.

Where should I normalize errors from external API calls in VTEX IO?

You should normalize errors from external API calls near the client boundary in VTEX IO. Surface meaningful failures close to the client layer without hiding critical HTTP or transport details from middlewares and resolvers.