# Swift SDK

The SurrealDB SDK for Swift enables simple and advanced querying of a remote database from Apple-platform and server-side Swift applications.

The SurrealDB SDK for Swift enables you to interact with SurrealDB from native Apple-platform applications (iOS, macOS, tvOS, watchOS and visionOS) as well as server-side Swift, allowing you to integrate SurrealDB into your app or backend and serve dynamic content to your users. You can use the Swift SDK to connect over HTTP or WebSocket, execute queries, manage data with type-safe CRUD via the `@SurrealModel` macro and query DSL, authenticate to the database, build user signup and signin functionality, and subscribe to data changes with live queries delivered as an `AsyncStream`.

> [!IMPORTANT]
> The SDK requires Swift `6.1` or later and works with SurrealDB `v3.0.0` or higher.
> Supported platforms are iOS 17+, macOS 14+, tvOS 17+, watchOS 10+ and visionOS 1+.

> [!NOTE]
> The SDK is distributed via [Swift Package Manager](/docs/reference/swift/installation.md) from the [surrealdb.swift](https://github.com/surrealdb/surrealdb.swift) repository, and will also be available on [Swift Package Index](https://swiftpackageindex.com).

## Getting started

- [Installation](/docs/reference/swift/installation.md) - Install the SDK and add it to your project.

- [Getting started guide](/docs/languages/swift.md) - Connect to SurrealDB and run your first queries.

## Learn

- [Concepts](/docs/reference/swift/concepts/connecting.md) - Guides for connecting, authenticating, querying, and working with data.

- [API Reference](/docs/reference/swift/methods.md) - Complete reference for the SDK's methods, types, and errors.

## Contributing

To contribute to the SDK code, submit an Issue or Pull Request in the [surrealdb.swift](https://github.com/surrealdb/surrealdb.swift) repository. To contribute to this documentation, submit an Issue or Pull Request in the [docs.surrealdb.com](https://github.com/surrealdb/docs.surrealdb.com) repository.

## Sources

- [GitHub repository](https://github.com/surrealdb/surrealdb.swift)
- [Swift Package Index](https://swiftpackageindex.com)
