Skip to content

kirkbyo/supabase-swift

This branch is 119 commits behind supabase/supabase-swift:main.

Folders and files

NameName
Last commit message
Last commit date
Jul 23, 2024
Jul 26, 2024
Jan 11, 2024
Sep 4, 2024
Sep 2, 2024
Sep 4, 2024
Jul 26, 2024
Aug 28, 2024
Jan 22, 2024
Apr 10, 2024
Apr 10, 2024
Jul 16, 2024
May 9, 2024
Jan 11, 2024
Apr 10, 2024
Sep 2, 2024
Oct 31, 2023
Apr 15, 2024
Sep 2, 2024
Jan 22, 2024
Jun 28, 2024
Jul 23, 2024
Aug 26, 2024
Jul 29, 2024
Apr 22, 2024
Jun 6, 2024

Repository files navigation

supabase-swift

Supabase client for swift. Mirrors the design of supabase-js.

Supported Platforms

Platform Support
iOS
macOS
watchOS
tvOS
visionOS
Linux ☑️
Windows ☑️

✅ Official support

☑️ Works but not officially supported, and not guaranttee to keep working on future versions of the library.

Usage

Install the library using the Swift Package Manager.

let package = Package(
    ...
    dependencies: [
        ...
        .package(
            url: "https://github.com/supabase-community/supabase-swift.git",
            from: "2.0.0"
        ),
    ],
    targets: [
        .target(
            name: "YourTargetName",
            dependencies: ["Supabase"] // Add as a dependency
        )
    ]
)

If you're using Xcode, use this guide to add supabase-swift to your project. Use https://github.com/supabase-community/supabase-swift.git for the url when Xcode asks.

If you don't want the full Supabase environment, you can also add individual packages, such as Functions, Auth, Realtime, Storage, or PostgREST.

Then you're able to import the package and establish the connection with the database.

/// Create a single supabase client for interacting with your database
let client = SupabaseClient(supabaseURL: URL(string: "https://xyzcompany.supabase.co")!, supabaseKey: "public-anon-key")

Initialize with custom options

let client = SupabaseClient(
    supabaseURL: URL(string: "https://xyzcompany.supabase.co")!, 
    supabaseKey: "public-anon-key",
    options: SupabaseClientOptions(
        db: .init(
            schema: "public"
        ),
        auth: .init(
            storage: MyCustomLocalStorage(),
            flowType: .pkce
        ),
        global: .init(
            headers: ["x-my-custom-header": "my-app-name"],
            session: URLSession.myCustomSession
        )
    )
)

Contributing

  • Fork the repo on GitHub
  • Clone the project to your own machine
  • Commit changes to your own branch
  • Push your work back up to your fork
  • Submit a Pull request so that we can review your changes and merge

Sponsors

We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.

New Sponsor

Releases

No releases published

Packages

No packages published

Languages

  • Swift 99.2%
  • Other 0.8%