Giter Site home page Giter Site logo

therickys93 / supabase-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supabase/supabase-swift

0.0 0.0 0.0 1.12 MB

A Swift client for Supabase

Home Page: https://supabase.com/docs/reference/swift

License: MIT License

Shell 0.31% Swift 99.16% Makefile 0.49% Dockerfile 0.04%

supabase-swift's Introduction

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

supabase-swift's People

Contributors

grdsdev avatar github-actions[bot] avatar dependabot[bot] avatar satishbabariya avatar angcosmin avatar leomehlig avatar thecoolwinter avatar gentilijuanmanuel avatar maail avatar bryandubno avatar zunda-pixel avatar multimokia avatar tmn avatar tyirenkyi avatar theolampert avatar saurabhjamadagni avatar mpross512 avatar mdloucks avatar mbarnach avatar iamlouislab avatar jxhug avatar james-william-r avatar jknlsn avatar florianmari avatar filipecabaco avatar ekurutepe avatar glowcap avatar colgates avatar christopheprat avatar brianmichel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.