adonisjs-services

Wrap external APIs behind a driver-managed service contract in AdonisJS.

2|1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/omakei/adonisjs-architecture-skill --skill adonisjs-services
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adonisjs-services
Source: https://github.com/omakei/adonisjs-architecture-skill/tree/main/adonisjs/skills/adonisjs-service
Command: npx skills add https://github.com/omakei/adonisjs-architecture-skill --skill adonisjs-services

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a clean architecture pattern for integrating external services in AdonisJS by wrapping APIs behind a manager/driver contract, enabling easy driver swapping and test-friendly null drivers.

Core Features & Use Cases

  • Manager/driver abstraction to wrap third-party APIs behind a single contract.
  • Multiple drivers (e.g., Stripe, Null driver) with runtime selection and IoC registration.
  • Deterministic testing via a null driver and test utilities, plus container-based behavior swapping for edge cases.
  • Safe, bounded driver caching within the manager to avoid leaks and ensure predictable memory usage.
  • Easy extension to add new providers with a minimal driver contract and central config.

Quick Start

Configure the test environment to use the null driver by setting PAYMENT_DRIVER=null.

Frequently Asked Questions about adonisjs-services

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

FAQPage Schema
How do I manage external APIs in AdonisJS with a driver pattern?

Manage external APIs in AdonisJS by wrapping them behind a manager/driver contract. This pattern supports multiple drivers, runtime swapping, and IoC-based singleton management for predictable behavior across environments.

What is the best way to test external API integrations in AdonisJS?

Test external API integrations in AdonisJS by using a null driver and dedicated test utilities. Set the configuration to select the null driver, enabling deterministic testing without hitting live third-party services.

How does dependency injection work for service providers in AdonisJS?

Dependency injection for AdonisJS service providers uses IoC-based singleton management to register drivers. The manager enforces bounded, per-app driver caching to avoid leaks and ensure predictable memory usage.

Can I swap payment drivers like Stripe at runtime in AdonisJS?

You can swap payment drivers like Stripe at runtime in AdonisJS through config-driven driver selection. The manager/driver abstraction allows dynamic selection and container-based behavior swapping for edge cases.

How do I add a new third-party provider to an AdonisJS service layer?

Add a new third-party provider to an AdonisJS service layer by implementing a minimal driver contract. Central configuration drives the selection, allowing safe and testable integrations with bounded caching.