11import StorageFileApi from './packages/StorageFileApi'
22import StorageBucketApi from './packages/StorageBucketApi'
3+ import StorageAnalyticsApi from './packages/StorageAnalyticsApi'
34import { Fetch } from './lib/fetch'
45import { StorageVectorsClient } from '@supabase/storage-vectors-js'
56
@@ -31,10 +32,33 @@ export class StorageClient extends StorageBucketApi {
3132 *
3233 * @returns A StorageVectorsClient instance configured with the current storage settings.
3334 */
34- vectors ( ) : StorageVectorsClient {
35+ get vectors ( ) : StorageVectorsClient {
3536 return new StorageVectorsClient ( this . url + '/vector' , {
3637 headers : this . headers ,
3738 fetch : this . fetch ,
3839 } )
3940 }
41+
42+ /**
43+ * Access analytics storage operations using Iceberg tables.
44+ *
45+ * @returns A StorageAnalyticsApi instance configured with the current storage settings.
46+ * @example
47+ * ```typescript
48+ * const client = createClient(url, key)
49+ * const analytics = client.storage.analytics
50+ *
51+ * // Create an analytics bucket
52+ * await analytics.createBucket('my-analytics-bucket', { public: false })
53+ *
54+ * // List all analytics buckets
55+ * const { data: buckets } = await analytics.listBuckets()
56+ *
57+ * // Delete an analytics bucket
58+ * await analytics.deleteBucket('old-analytics-bucket')
59+ * ```
60+ */
61+ get analytics ( ) : StorageAnalyticsApi {
62+ return new StorageAnalyticsApi ( this . url + '/iceberg' , this . headers , this . fetch )
63+ }
4064}
0 commit comments