Supabase.Fable 1.1.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Supabase.Fable --version 1.1.1
                    
NuGet\Install-Package Supabase.Fable -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Supabase.Fable" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Supabase.Fable" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Supabase.Fable" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Supabase.Fable --version 1.1.1
                    
#r "nuget: Supabase.Fable, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Supabase.Fable@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Supabase.Fable&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Supabase.Fable&version=1.1.1
                    
Install as a Cake Tool

Supabase.Fable

Supabase.Fable

F# bindings for Supabase JavaScript libraries via Fable.

Installation

For Fable projects

  1. Install the F# package:
dotnet add package Supabase.Fable
  1. Install the JavaScript dependency:
npm install @supabase/supabase-js

Usage

In F# (Fable) projects

open Supabase.Fable.Client

// Create a client
let client = createSimple "YOUR_SUPABASE_URL" "YOUR_SUPABASE_ANON_KEY"

// Use authentication
let! result = client.Auth.SignUp("user@example.com", "password")

// Query data  
let! data = client.From<MyRecord>("my_table").Select("*").Execute()

In Oxpecker.Solid components

open Oxpecker.Solid
open Supabase.Fable.Client

let supabaseUrl = "YOUR_SUPABASE_URL"
let supabaseKey = "YOUR_SUPABASE_ANON_KEY" 

[<SolidComponent>]
let MyComponent() =
    let client = createSimple supabaseUrl supabaseKey
    let data, setData = createSignal [||]
    
    onMount(fun () ->
        promise {
            let! result = client.From<MyRecord>("my_table").Select("*").Execute()
            match result with
            | Ok records -> setData(records)
            | Error err -> console.error(err)
        } |> ignore
    )
    
    div() {
        For(each = data()) {
            yield fun item _ -> 
                div() { item.Name }
        }
    }

Dependencies

This library requires:

  • @supabase/supabase-js (JavaScript dependency)
  • Fable.Core (F# dependency)
  • Fable.Promise (F# dependency)

API

The library provides F# bindings for:

  • Authentication (client.Auth)
  • Database queries (client.From<'T>())
  • Storage (client.Storage)
  • Realtime (client.Realtime)

See the Supabase documentation for detailed API usage.

Features

  • Type-safe F# bindings for the complete Supabase JavaScript API
  • Promise-based async operations using F# async workflows
  • Comprehensive coverage of Authentication, Database, Storage, and Realtime APIs
  • Fable.Core integration for seamless JavaScript interop
  • Complete examples and test suite

Installation

  1. Add this library and the Fable package references to your project:

    <PackageReference Include="Fable.Core" Version="4.5.0" />
    <PackageReference Include="Fable.Promise" Version="3.2.0" />
    <PackageReference Include="Supabase.Fable" Version="[1.0.0, 2.0.0)" />
    
  2. Install the required npm dependencies:

    npm install @supabase/supabase-js
    

Quick Start

open Supabase.Fable.Client

// Create a Supabase client
let supabaseUrl = "https://your-project.supabase.co"
let supabaseKey = "your-anon-key-here"
let client = createSimple supabaseUrl supabaseKey

// Example: Authentication
let signUpUser() = promise {
    let! result = client.Auth.SignUp("user@example.com", "password123")
    match result.data with
    | Some data -> printfn $"User created: {data.user.email}"
    | None -> printfn "Sign up failed"
}

// Example: Database query
let getUsers() = promise {
    let! response = client.From("users").Select("*").Execute()
    match response.data with
    | Some users -> printfn $"Found {users.Length} users"
    | None -> printfn "Query failed"
}

API Coverage

Authentication (client.Auth)

  • SignUp(email, password) - Create new user account
  • SignInWithPassword(email, password) - Sign in with email/password
  • SignInWithOAuth(provider) - Sign in with OAuth provider
  • SignOut() - Sign out current user
  • GetUser(jwt) - Get current user
  • GetSession() - Get current session
  • RefreshSession() - Refresh current session
  • ResetPasswordForEmail(email) - Send password reset email

Database (client.From(table))

Query Builder:

  • Select(columns) - Select specific columns
  • Insert(data) - Insert new records
  • Update(data) - Update existing records
  • Delete() - Delete records
  • Upsert(data) - Insert or update records

Filters:

  • Eq(column, value) - Equals filter
  • Neq(column, value) - Not equals filter
  • Gt(column, value) - Greater than filter
  • Gte(column, value) - Greater than or equal filter
  • Lt(column, value) - Less than filter
  • Lte(column, value) - Less than or equal filter
  • Like(column, pattern) - Pattern matching filter
  • In(column, values) - Value in list filter

Modifiers:

  • Order(column, ascending) - Sort results
  • Limit(count) - Limit number of results
  • Range(from, to) - Range pagination
  • Single() - Get single record
  • Execute() - Execute query

Storage (client.Storage)

Bucket Management:

  • ListBuckets() - List all buckets
  • GetBucket(id) - Get bucket details
  • CreateBucket(id, options) - Create new bucket
  • DeleteBucket(id) - Delete bucket
  • EmptyBucket(id) - Empty bucket contents

File Operations: (client.Storage.From(bucket))

  • Upload(path, file, options) - Upload file
  • Download(path) - Download file
  • Remove(paths) - Delete files
  • List(path, options) - List files
  • GetPublicUrl(path) - Get public URL
  • CreateSignedUrl(path, expiresIn) - Create signed URL

Realtime (client.Realtime)

  • Channel(topic) - Create realtime channel
  • Subscribe(callback) - Subscribe to changes
  • Unsubscribe() - Unsubscribe from changes
  • GetChannels() - Get active channels

Examples

The examples/ directory contains comprehensive examples showing:

  • Authentication flows - Sign up, sign in, session management
  • Database operations - CRUD operations with type-safe queries
  • Storage management - File upload, download, and bucket management
  • Realtime subscriptions - Live updates and change notifications

Run the examples:

cd examples
dotnet build
# For browser: compile with Fable and open in browser
# For Node.js: run with Node.js after Fable compilation

Testing

The tests/ directory contains unit tests using Fable.Mocha:

cd tests
dotnet build
# Compile with Fable and run in test environment

Project Structure

src/
├── Types.fs           # Supabase type definitions
├── Bindings.fs        # JavaScript interop bindings
├── SupabaseClient.fs  # Main client interface
├── Auth.fs            # Authentication module
├── Database.fs        # Database query builder
├── Storage.fs         # Storage management
└── Realtime.fs        # Realtime subscriptions

examples/
└── Examples.fs        # Comprehensive usage examples

tests/
└── Tests.fs           # Unit test suite

Type Safety

All Supabase operations are wrapped in F# types for compile-time safety:

// Responses are wrapped in Result-like types
type SupabaseResponse<'T> = {
    data: 'T option
    error: SupabaseError option
}

// User-defined types are preserved
type User = {
    id: int option
    name: string
    email: string
    created_at: string option
}

// Type-safe database operations
let getUser (id: int) = promise {
    let! response = client.From("users").Select("*").Eq("id", id).Single()
    return response.data // User option
}

Browser vs Node.js

This library works in both browser and Node.js environments:

  • Browser: Use with Fable.React, Elmish, or any Fable web framework
  • Node.js: Use for server-side F# applications with Supabase

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all projects build: dotnet build
  5. Submit a pull request

Dependencies

  • Fable.Core 4.5.0+ - Core Fable compilation support
  • @supabase/supabase-js 2.57.4+ - Supabase JavaScript client
  • Fable.Promise 3.2.0+ - Promise-based async operations (optional)
  • Fable.Mocha 2.17.0+ - Testing framework (dev dependency)

License

MIT License - see LICENSE file for details

Supabase Resources

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated