Installation
Add InsForge to your Swift Package Manager dependencies:Enable Logging (Optional)
For debugging, you can configure the SDK log level and destination:
Log Destinations:
Use
.info or .error in production to avoid exposing sensitive data in logs.from()
Get a file API reference for a bucket.Example
Bucket Operations
createBucket()
Creates a new storage bucket.listBuckets()
List all bucket names.updateBucket()
Update a bucket’s visibility.deleteBucket()
Delete a bucket.upload()
Upload a file to the bucket.Parameters
path(String) - The object key/path for the filedata(Data) - File data to uploadoptions(FileOptions, optional) - Upload options including contentType
Examples
download()
Download a file as Data.Example
list()
List files in a bucket.Parameters
options(ListOptions, optional) - Options including prefix, limit, offset