Skip to main content

Installation

Add InsForge to your Swift Package Manager dependencies:

Enable Logging (Optional)

For debugging, you can configure the SDK log level and destination:
Log Levels: 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 file
  • data (Data) - File data to upload
  • options (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

Examples


delete()

Delete a file from storage.

Example


getPublicURL()

Get a public URL for a file in a public bucket.

Example


Upload Strategy

Get upload strategy for large files (direct or presigned URL).

getUploadStrategy()

confirmUpload()

Confirm a presigned upload after uploading directly to S3.

Download Strategy

Get download strategy for private files (direct or presigned URL).

getDownloadStrategy()


Options Reference

FileOptions

Options for file upload operations.

BucketOptions

Options for bucket creation/update.

ListOptions

Options for listing files.

StoredFile Model

The response model for storage operations.