core/network

Manage HTTP requests, token authentication, and error mapping for Compose Multiplatform apps.

46|5|Updated Aug 31, 2025
One-click install
npx skills add https://github.com/cloner93/ExpenseShare --skill core-network
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core/network
Source: https://github.com/cloner93/ExpenseShare/tree/main/core/network
Command: npx skills add https://github.com/cloner93/ExpenseShare --skill core-network

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ktor-client-*, koin-core, kotlinx-serialization-json, core/logger, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust HTTP client infrastructure for the Compose Multiplatform app, handling request building, authentication, error mapping, and a network manager abstraction.

Core Features & Use Cases

  • HTTP Client Infrastructure: Offers a structured approach to building HTTP requests, managing authentication, and handling errors.
  • NetworkManager: Serves as the primary interface for repositories, wrapping responses in Flow<Result<T>>.
  • Authentication: Manages token-based authentication with in-memory storage and automatic header injection.
  • Error Handling: Maps HTTP status codes to typed exceptions for robust error management.
  • Platform-specific Engines: Supports Android, iOS, JVM Desktop, and wasmJs with appropriate HTTP client engines.

Quick Start

Use the core/network skill to execute a GET request to the endpoint '/groups' with the necessary headers.

Frequently Asked Questions about core/network

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

FAQPage Schema
How do I set up an HTTP client with token authentication in a Compose Multiplatform app?

To set up an HTTP client with token authentication in a Compose Multiplatform app, you need infrastructure that manages request construction, in-memory token storage, and automatic header injection. This approach handles RESTful API interactions robustly across platforms.

What is the best way to handle HTTP errors and map status codes to typed exceptions in Ktor?

Handling HTTP errors and mapping status codes to typed exceptions in Ktor requires an error mapping mechanism that translates HTTP responses into typed exceptions. This ensures robust error management and allows repositories to wrap responses in Flow Result.

Does this networking infrastructure support different HTTP engines for Android, iOS, JVM, and wasmJs?

Yes, this networking infrastructure supports platform-specific HTTP engines for Android, iOS, JVM Desktop, and wasmJs. It automatically provides the appropriate HTTP client engines required for each target platform within a Compose Multiplatform environment.

How do I execute a GET request and wrap the response in a Flow using a Ktor NetworkManager?

To execute a GET request and wrap the response in a Flow using a Ktor NetworkManager, you call the primary interface provided for repositories. This interface builds the HTTP request and automatically wraps the response data in a Flow Result.

Can I use kotlinx-serialization-json to parse API responses with this Compose Multiplatform HTTP client?

Yes, you can use kotlinx-serialization-json to parse API responses with this Compose Multiplatform HTTP client. The infrastructure integrates serialization dependencies to handle JSON parsing during RESTful API interactions and network management tasks.

Why do I need koin-core for a Ktor HTTP client setup in Compose Multiplatform?

You need koin-core for a Ktor HTTP client setup in Compose Multiplatform to manage dependency injection across the networking infrastructure. It helps provide the NetworkManager, HTTP engines, and token authentication components to repositories efficiently.