Liking cljdoc? Tell your friends :D

supabase.storage

Object storage against Supabase Storage.

Provides bucket CRUD plus per-bucket file operations (list, remove, move, copy, info, exists?, public/signed URLs, upload, download). Per-bucket ops take a storage instance returned by from. Analytics bucket operations live in supabase.storage.analytics. ops take a storage instance returned by from. Vector bucket, index, and vector data operations live in supabase.storage.vector.

Example

(require '[supabase.core.client :as client]
         '[supabase.storage :as storage])

(def c (client/make-client "https://abc.supabase.co" "anon-key"))

(storage/list-buckets c)
(storage/create-bucket c "avatars" {:public true})

(def s (storage/from c "avatars"))
(storage/upload s "profile.png" my-bytes
                {:content-type "image/png" :upsert true})
(storage/download s "profile.png")
(storage/get-public-url s "profile.png")

Each function returns {:status :body :headers} on success or an anomaly map on failure. See https://supabase.com/docs/reference/javascript/storage-api

Object storage against Supabase Storage.

Provides bucket CRUD plus per-bucket file operations (list, remove, move,
copy, info, exists?, public/signed URLs, upload, download). Per-bucket
ops take a storage instance returned by `from`. Analytics bucket
operations live in `supabase.storage.analytics`.
ops take a storage instance returned by `from`. Vector bucket, index, and
vector data operations live in `supabase.storage.vector`.

## Example

    (require '[supabase.core.client :as client]
             '[supabase.storage :as storage])

    (def c (client/make-client "https://abc.supabase.co" "anon-key"))

    (storage/list-buckets c)
    (storage/create-bucket c "avatars" {:public true})

    (def s (storage/from c "avatars"))
    (storage/upload s "profile.png" my-bytes
                    {:content-type "image/png" :upsert true})
    (storage/download s "profile.png")
    (storage/get-public-url s "profile.png")

Each function returns `{:status :body :headers}` on success or an anomaly
map on failure. See https://supabase.com/docs/reference/javascript/storage-api
raw docstring

supabase.storage.analytics

Analytics buckets (Iceberg tables) against Supabase Storage.

Provides analytics bucket CRUD (create, list, delete) plus catalog-info, which returns the connection details needed to point an Iceberg REST catalog client at a bucket. These are project-level operations and take the client directly.

Public alpha: this API is part of a public alpha release and may not be available to your account type.

Example

(require '[supabase.core.client :as client]
         '[supabase.storage.analytics :as analytics])

(def c (client/make-client "https://abc.supabase.co" "anon-key"))

(analytics/create-bucket c "analytics-data")
(analytics/list-buckets c {:limit 10 :sort-column :created-at
                           :sort-order :desc})
(analytics/catalog-info c)

Each function returns {:status :body :headers} on success or an anomaly map on failure. Endpoints live under {storage-url}/iceberg. See https://supabase.com/docs/reference/javascript/storage-analytics-api

Analytics buckets (Iceberg tables) against Supabase Storage.

Provides analytics bucket CRUD (create, list, delete) plus
`catalog-info`, which returns the connection details needed to point
an Iceberg REST catalog client at a bucket. These are project-level
operations and take the client directly.

Public alpha: this API is part of a public alpha release and may not
be available to your account type.

## Example

    (require '[supabase.core.client :as client]
             '[supabase.storage.analytics :as analytics])

    (def c (client/make-client "https://abc.supabase.co" "anon-key"))

    (analytics/create-bucket c "analytics-data")
    (analytics/list-buckets c {:limit 10 :sort-column :created-at
                               :sort-order :desc})
    (analytics/catalog-info c)

Each function returns `{:status :body :headers}` on success or an
anomaly map on failure. Endpoints live under `{storage-url}/iceberg`.
See https://supabase.com/docs/reference/javascript/storage-analytics-api
raw docstring

supabase.storage.specs

Malli schemas for Supabase Storage operation inputs.

Schemas validate caller arguments only — response bodies are returned as plain JSON-decoded maps. See https://supabase.com/docs/reference/javascript/storage-createbucket

Malli schemas for Supabase Storage operation inputs.

Schemas validate caller arguments only — response bodies are returned as
plain JSON-decoded maps. See https://supabase.com/docs/reference/javascript/storage-createbucket
raw docstring

supabase.storage.vector

Vector buckets, indexes, and vector data against Supabase Storage.

Provides vector bucket CRUD, per-bucket index operations, and per-index vector data operations (put, get, list, query, delete). Index ops take an instance returned by from; vector data ops take an instance further scoped by index.

Example

(require '[supabase.core.client :as client]
         '[supabase.storage.vector :as vector])

(def c (client/make-client "https://abc.supabase.co" "anon-key"))

(vector/create-bucket (vector/from c) "embeddings")

(def b (vector/from c "embeddings"))
(vector/create-index b {:index-name "docs"
                        :data-type :float32
                        :dimension 384
                        :distance-metric :cosine})

(def i (vector/index b "docs"))
(vector/put-vectors i [{:key "doc-1" :data {:float32 [0.1 0.2]}}])
(vector/query-vectors i {:query-vector {:float32 [0.1 0.2]} :top-k 5})

Each function returns {:status :body :headers} on success or an anomaly map on failure. All endpoints are POSTs under {storage-url}/vector with camelCase JSON bodies. See https://supabase.com/docs/reference/javascript/storage-vector-api

Vector buckets, indexes, and vector data against Supabase Storage.

Provides vector bucket CRUD, per-bucket index operations, and
per-index vector data operations (put, get, list, query, delete).
Index ops take an instance returned by `from`; vector data ops take an
instance further scoped by `index`.

## Example

    (require '[supabase.core.client :as client]
             '[supabase.storage.vector :as vector])

    (def c (client/make-client "https://abc.supabase.co" "anon-key"))

    (vector/create-bucket (vector/from c) "embeddings")

    (def b (vector/from c "embeddings"))
    (vector/create-index b {:index-name "docs"
                            :data-type :float32
                            :dimension 384
                            :distance-metric :cosine})

    (def i (vector/index b "docs"))
    (vector/put-vectors i [{:key "doc-1" :data {:float32 [0.1 0.2]}}])
    (vector/query-vectors i {:query-vector {:float32 [0.1 0.2]} :top-k 5})

Each function returns `{:status :body :headers}` on success or an anomaly
map on failure. All endpoints are POSTs under `{storage-url}/vector` with
camelCase JSON bodies. See
https://supabase.com/docs/reference/javascript/storage-vector-api
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close