Logo Aurabase
aurabasedocuments
documents›JavaScript SDK reference›Storage reference

SDK JavaScript : référence de stockage

Chaque méthode qui gère les buckets et les objets, avec sa signature.

6 min de lecture·Niveau référence·Révisé le 12 oct. 2026
Ce texte anglais a été généré automatiquement à partir de l’original français et n’a pas encore été relu.
Cette page a été traduite automatiquement. La version anglaise fait foi.
#
Classe

Service de stockage

MéthodeDescriptif
from(bucketId: string): StorageBucketClientRenvoie un client limité à un compartiment spécifique (parité DX Supabase).
listBuckets(): Promise<AuraResponse<StorageBucket[]>>Répertoriez les compartiments du projet.
getBucket(id: string): Promise<AuraResponse<StorageBucket>>Lit un compartiment par son identifiant.
createBucket(name: string, options?: { public?: boolean; fileSizeLimit?: number; allowedMimeTypes?: string[]; }): Promise<AuraResponse<StorageBucket>>Créez un compartiment. public (par défaut false) rend ses objets lisibles sans authentification ; fileSizeLimit (en octets) et allowedMimeTypes limitent les fichiers acceptés.
updateBucket(id: string, options?: { public?: boolean; fileSizeLimit?: number; allowedMimeTypes?: string[]; }): Promise<AuraResponse<StorageBucket>>Met à jour un bucket existant (mise à jour PARTIELLE : seuls les champs fournis sont envoyés).
deleteBucket(id: string): Promise<AuraResponse<null>>Supprime un bucket par son identifiant.
upload(bucketId: string, path: string, file: Blob | File | ArrayBuffer, options?: { contentType?: string; upsert?: boolean; metadata?: Record<string, string>; }): Promise<AuraResponse<UploadResult>>Téléchargez un fichier dans un bucket.
download(bucketId: string, path: string, options?: { transform?: ImageTransform; }): BlobDownloadBuilderTéléchargement paresseux d'un fichier.
list(bucketId: string, options?: { prefix?: string; limit?: number; offset?: number; cursor?: string; }): Promise<AuraResponse<FileEntry[]>>Répertoriez les fichiers dans un compartiment.
remove(bucketId: string, paths: string[], options?: { permanent?: boolean; }): Promise<AuraResponse<null>>Supprimez un ou plusieurs fichiers d'un compartiment.
copy(bucketId: string, fromPath: string, toPath: string): Promise<AuraResponse<{ key: string; }>>Copiez un fichier dans un compartiment.
move(bucketId: string, fromPath: string, toPath: string): Promise<AuraResponse<{ key: string; }>>Déplacer/renommer un fichier dans un bucket.
getMetadata(bucketId: string, path: string): Promise<AuraResponse<ObjectMeta>>Obtenez les métadonnées du fichier.
createSignedUrl(bucketId: string, path: string, expiresInSeconds?: number, options?: { transform?: ImageTransform; }): Promise<AuraResponse<{ url: string; expires_in: number; }>>Générez une URL de téléchargement signée (temporaire).
createSignedUrls(bucketId: string, paths: string[], expiresInSeconds?: number, options?: { transform?: ImageTransform; }): Promise<AuraResponse<Array<{ path: string; url: string; expires_in: number; } | { path: string; error: AuraError; }>>>Génère plusieurs URL signées en une seule passe (batch).
createSignedUploadUrl(bucketId: string, path: string, expiresInSeconds?: number, options?: { upsert?: boolean; }): Promise<AuraResponse<{ url: string; expires_in: number; }>>Générez une URL de téléchargement signée (PUT présignée).
getPublicUrl(bucketId: string, path: string, options?: { transform?: ImageTransform; }): stringConstruit une URL vers un fichier dans un compartiment.
#
Classe

ClientBucketde Stockage

Accédez au client limité à un compartiment spécifique (parité DX Supabase).

PropriétéDescriptif
readonly bucketId: stringIdentifiant du bucket auquel ce client est lié : toutes ses méthodes agissent sur ce bucket.
MéthodeDescriptif
upload(path: string, file: Blob | File | ArrayBuffer, options?: { contentType?: string; upsert?: boolean; metadata?: Record<string, string>; }): Promise<AuraResponse<UploadResult>>Téléchargez un fichier dans ce bucket.
download(path: string, options?: { transform?: ImageTransform; }): BlobDownloadBuilderTéléchargez un fichier à partir de ce compartiment.
list(options?: { prefix?: string; limit?: number; offset?: number; cursor?: string; }): Promise<AuraResponse<FileEntry[]>>Répertoriez les fichiers de ce compartiment.
remove(paths: string[], options?: { permanent?: boolean; }): Promise<AuraResponse<null>>Supprime un ou plusieurs fichiers de ce compartiment.
createSignedUrl(path: string, expiresInSeconds?: number, options?: { transform?: ImageTransform; }): Promise<AuraResponse<{ url: string; expires_in: number; }>>Crée une URL signée temporaire pour un fichier dans ce compartiment.
createSignedUrls(paths: string[], expiresInSeconds?: number, options?: { transform?: ImageTransform; }): Promise<AuraResponse<Array<{ path: string; url: string; expires_in: number; } | { path: string; error: AuraError; }>>>Crée plusieurs URL signées en une seule passe pour ce compartiment.
createSignedUploadUrl(path: string, expiresInSeconds?: number, options?: { upsert?: boolean; }): Promise<AuraResponse<{ url: string; expires_in: number; }>>Crée une URL de téléchargement présignée (PUT direct).
getPublicUrl(path: string, options?: { transform?: ImageTransform; }): { data: { publicUrl: string; }; }Renvoie l'URL publique d'un fichier dans ce compartiment.
#
Classe

BlobDownloadBuilder

Téléchargement paresseux (Blob par défaut).

MéthodeDescriptif
asStream(): StreamDownloadBuilderPasse en lecture streaming : le résultat devient un ReadableStream au lieu d'un Blob chargé en mémoire.
then<TR1 = AuraResponse<Blob>, TR2 = never>(onfulfilled?: ((v: AuraResponse<Blob>) => TR1 | PromiseLike<TR1>) | null, onrejected?: ((e: unknown) => TR2 | PromiseLike<TR2>) | null): Promise<TR1 | TR2>Déclenche le téléchargement (paresseux : la requête ne démarre qu'à await) ; le résultat est mémorisé.
#
Classe

StreamDownloadBuilder

Flux de variantes — res.body (ReadableStream).

MéthodeDescriptif
then<TR1 = AuraResponse<ReadableStream<Uint8Array>>, TR2 = never>(onfulfilled?: ((v: AuraResponse<ReadableStream<Uint8Array>>) => TR1 | PromiseLike<TR1>) | null, onrejected?: ((e: unknown) => TR2 | PromiseLike<TR2>) | null): Promise<TR1 | TR2>Déclenche le téléchargement en streaming (paresseux) ; le résultat est mémorisé.
Page générée

Cette page est générée à partir des déclarations de type et des commentaires du SDK, elle ne peut donc pas dériver du code publié. Pour des exemples concrets, lisez les guides.

Dernière mise à jour · 12 oct. 2026