Scryfall

constructor(config: ScryfallConfig = ScryfallConfig(), engine: HttpClientEngine? = null, logger: (String) -> Unit? = null)

Parameters

config

Configuration options for the API client

engine

Optional custom Ktor HTTP engine for testing or advanced use cases

logger

Optional custom logger function for logging HTTP requests/responses. If provided and logging is enabled in config, this logger will be used. If not provided, the default platform logger will be used.

Example usage:

// Basic usage
val scryfall = Scryfall()
val cards = scryfall.cards.search("Lightning Bolt")

// With logging enabled
val scryfall = Scryfall(
config = ScryfallConfig(enableLogging = true),
logger = { message -> println("Scryfall: $message") }
)