https://github.com/grdsdev/swift-supabase-auth-http
A Swift HTTP client for Supabase Auth generated from the official OpenAPI specification using Apple's Swift OpenAPI Generator.
https://github.com/grdsdev/swift-supabase-auth-http
Last synced: about 1 month ago
JSON representation
A Swift HTTP client for Supabase Auth generated from the official OpenAPI specification using Apple's Swift OpenAPI Generator.
- Host: GitHub
- URL: https://github.com/grdsdev/swift-supabase-auth-http
- Owner: grdsdev
- Created: 2025-10-29T13:22:42.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-16T10:19:31.000Z (7 months ago)
- Last Synced: 2025-12-19T23:31:16.290Z (7 months ago)
- Language: Swift
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift Supabase Auth HTTP Client
A Swift HTTP client for Supabase Auth generated from the official OpenAPI specification using Apple's Swift OpenAPI Generator.
## ⚠️ Warning
**This is a Proof of Concept (POC) and is not meant for production use.**
This project is experimental and should not be used in production environments. It's intended for:
- Learning and experimentation
- Testing Swift OpenAPI Generator capabilities
## Overview
This package provides a type-safe Swift client for the Supabase Auth REST API, automatically generated from the official OpenAPI specification. It includes:
- Complete type definitions for all Supabase Auth API endpoints
- Type-safe request/response handling
- Support for all authentication flows (password, OAuth, Web3, etc.)
- Generated from the latest Supabase Auth OpenAPI spec
## Requirements
- Swift 6.0+
- macOS 10.15+, iOS 13+, tvOS 13+, watchOS 6+, visionOS 1+
## Installation
Add this package to your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/grdsdev/swift-supabase-auth-http", branch: "main")
]
```
## Usage
```swift
import SupabaseAuthHTTP
import OpenAPIURLSession
// Create a client
let client = Client(
serverURL: URL(string: "https://your-project.supabase.co/auth/v1")!,
transport: URLSessionTransport()
)
// Example: Sign in with email and password
let response = try await client.postToken(
.init(
query: .init(grant_type: .password),
body: .json(.init(
email: "user@example.com",
password: "password123"
))
)
)
```
## Development
### Prerequisites
- Swift 6.0+
- Make
### Updating the OpenAPI Specification
To pull the latest OpenAPI spec from Supabase:
```bash
make pull-spec
```
### Generating Swift Code
To regenerate the Swift client from the OpenAPI spec:
```bash
make generate
```
### Building
```bash
make build
```
### Available Make Targets
- `make help` - Show all available targets
- `make pull-spec` - Download latest OpenAPI spec from Supabase
- `make generate` - Generate Swift client from OpenAPI spec
- `make build` - Build the package
- `make clean` - Clean generated files
- `make clean-all` - Clean everything including dependencies
## Project Structure
```
Sources/SupabaseAuthHTTP/Generated/
├── Client.swift # Generated HTTP client
└── Types.swift # Generated type definitions
```
## Dependencies
This package depends on:
- [Swift OpenAPI Runtime](https://github.com/apple/swift-openapi-runtime)
- [Swift OpenAPI URLSession](https://github.com/apple/swift-openapi-urlsession)
## Related Projects
- [Supabase Auth](https://supabase.com/auth) - The official Supabase Auth service
- [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator) - Apple's OpenAPI code generator
- [Supabase Swift](https://github.com/supabase/supabase-swift) - Official Supabase Swift client