Yasminaai Swift Library
Table of Contents
Requirements
This SDK requires:- Swift 5.7+
- iOS 15+
- macOS 12+
- tvOS 15+
- watchOS 8+
Installation
With Swift Package Manager (SPM), add the following to the top-leveldependencies array within your Package.swift file:
Reference
A full reference for this library is available here.Usage
Instantiate and use the client with the following:Environments
This SDK allows you to configure different environments for API requests.Errors
The SDK throws a single error enum for all failures. Client-side issues encoding/decoding failures and network errors use dedicated cases, while non-success HTTP responses are wrapped in anHTTPError that exposes the status code, a simple classification and an optional decoded message.
Request Types
The SDK exports all request types as Swift structs. Simply import the SDK module to access them:Advanced
Additional Headers
If you would like to send additional headers as part of the request, use theadditionalHeaders request option.
Additional Query String Parameters
If you would like to send additional query string parameters as part of the request, use theadditionalQueryParameters request option.
Timeouts
The SDK defaults to a 60-second timeout. Use thetimeout option to configure this behavior.
Custom Networking Client
The SDK allows you to customize the underlyingURLSession used for HTTP requests. Use the urlSession option to provide your own configured URLSession instance.

