{"id":20159554,"url":"https://github.com/transloadit/transloaditkit","last_synced_at":"2025-09-12T17:33:36.466Z","repository":{"id":21938834,"uuid":"66957673","full_name":"transloadit/TransloaditKit","owner":"transloadit","description":"An iOS and macOS integration for Transloadit's file uploading and encoding service","archived":false,"fork":false,"pushed_at":"2025-08-15T12:58:29.000Z","size":875,"stargazers_count":18,"open_issues_count":4,"forks_count":12,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-08-15T14:55:01.886Z","etag":null,"topics":["encoding","ios","macos","osx","sdk","transloadit","uploading"],"latest_commit_sha":null,"homepage":"https://transloadit.com/docs/#sdks","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transloadit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-30T16:19:56.000Z","updated_at":"2025-07-04T07:42:47.000Z","dependencies_parsed_at":"2025-08-17T10:01:44.122Z","dependency_job_id":null,"html_url":"https://github.com/transloadit/TransloaditKit","commit_stats":{"total_commits":92,"total_committers":8,"mean_commits":11.5,"dds":0.6739130434782609,"last_synced_commit":"09359c8458a30450486d92443990adba6742aeb2"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/transloadit/TransloaditKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2FTransloaditKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2FTransloaditKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2FTransloaditKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2FTransloaditKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transloadit","download_url":"https://codeload.github.com/transloadit/TransloaditKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2FTransloaditKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274847537,"owners_count":25360978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","ios","macos","osx","sdk","transloadit","uploading"],"created_at":"2024-11-14T00:08:56.966Z","updated_at":"2025-09-12T17:33:36.420Z","avatar_url":"https://github.com/transloadit.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TransloaditKit\n\nAn **iOS** and **macOS** integration for [Transloadit](https://transloadit.com)'s file uploading and encoding service\n\n## Install\n\n### CocoaPods\n\n```ruby\npod 'Transloadit', '~\u003e 3.0'\n```\n\n### Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/transloadit/TransloaditKit\", .upToNextMajor(from: \"3.0.0\"))\n]\n```\n\n## Usage\n\nStart by initializing `Transloadit`.\n\n### Simple initialization; pass key and secret to the SDK\n\n```swift\nlet credentials = Transloadit.Credentials(key: \"SomeKey\", secret: \"SomeSecret\")\nlet transloadit = Transloadit(credentials: credentials, session: URLSession.shared)\n```\n\nCertain transloadit endpoints (can) require signatures to be included in their requests. The SDK can automatically generate signatures on your behalf but this requires you to pass both your Transloadit key _and_ secret to the SDK.\n\nThe SDK does not persist your secret locally beyond the SDK's lifetime.\n\nThis means that you're free to obtain your SDK secret in a secure manner from an external host or that you can include it in your app binary. It's up to you.\n\nIt's also possible to initialize the SDK with a `nil` secret and manage signing yourself.\n\n### Advanced initialization; omit secret for manual request signing\n\nIf, for security reasons, you choose to not expose your API secret to the app in any way, shape, or form, you can manage signature generation yourself. This allows you to generate signatures on your server and provide them to Transloadit as needed.\n\nTo do this, use the `Transloadit` initializer that takes an api key and a `signatureGenerator`\n\n```swift\nlet transloadit = Transloadit(\n    apiKey: \"YOUR-API-KEY\", \n    sessionConfiguration: .default, \n    signatureGenerator: { stringToSign, onSignatureGenerated in\n        mySigningService.sign(stringToSign) { result in \n          onSignatureGenerated(result)\n        }\n    })\n```\n\nThe signature generator is defined as follows:\n\n```swift\npublic typealias SignatureCompletion = (Result\u003cString, Error\u003e) -\u003e Void\npublic typealias SignatureGenerator = (String, SignatureCompletion) -\u003e Void\n```\n\nThe generator itself is passed a string that needs to be signed (a JSON representation of the request parameters that you're generating a signature for) and a closure that you _must_ call to inform the SDK when you're done generating the signature (whether it's successful or failed).\n\n**Important** if you don't call the completion handler, your requests will never be sent. The SDK does not implement a fallback or timeout. \n\nThe SDK will invoke the signature generator for every request that requires a signature. It will pass a parameter string for each request to your closure which you can then send to your service (local or external) for signature generation.\n\nTo learn more about signature generation see this page: https://transloadit.com/docs/api/authentication/\n\n### Create an Assembly\n\nTo create an `Assembly` you invoke `createAssembly(steps:andUpload:completion)` on `Transloadit`.\nIt returns a `TransloaditPoller` that you can use to poll for the `AssemblyStatus` of your `Assembly`.\n\n```swift\nlet resizeStep = Step(\n    name: \"resize\",\n    robot: \"/image/resize\",\n    options: [\n        \"width\": 200,\n        \"height\": 100,\n        \"resize_strategy\": \"fit\",\n        \"result\": true])\n        \nlet filesToUpload: [URL] = ...\ntransloadit.createAssembly(steps: [resizeStep], andUpload: filesToUpload) { result in\n    switch result {\n    case .success(let assembly):\n        print(\"Retrieved \\(assembly)\")\n    case .failure(let error):\n        print(\"Assembly error \\(error)\")\n    }\n}.pollAssemblyStatus { result in\n    switch result {\n    case .success(let assemblyStatus):\n        print(\"Received assemblystatus \\(assemblyStatus)\")\n    case .failure(let error):\n        print(\"Caught polling error \\(error)\")\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Ftransloaditkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransloadit%2Ftransloaditkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Ftransloaditkit/lists"}