{"id":31039429,"url":"https://github.com/clevertap/clevertap-segment-swift","last_synced_at":"2026-08-05T01:31:44.151Z","repository":{"id":313308263,"uuid":"817149732","full_name":"CleverTap/clevertap-segment-swift","owner":"CleverTap","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-05T06:11:43.000Z","size":209,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-05T08:21:19.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleverTap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-19T06:02:56.000Z","updated_at":"2024-06-19T06:03:01.000Z","dependencies_parsed_at":"2025-09-05T08:21:38.654Z","dependency_job_id":"c83bc3c0-1d16-4c1b-8972-52a41a859704","html_url":"https://github.com/CleverTap/clevertap-segment-swift","commit_stats":null,"previous_names":["clevertap/clevertap-segment-swift"],"tags_count":1,"template":false,"template_full_name":"segment-integrations/analytics-swift-destination-template","purl":"pkg:github/CleverTap/clevertap-segment-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleverTap","download_url":"https://codeload.github.com/CleverTap/clevertap-segment-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275076592,"owners_count":25401317,"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-14T02:00:10.474Z","response_time":75,"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":[],"created_at":"2025-09-14T07:57:28.488Z","updated_at":"2026-08-05T01:31:44.090Z","avatar_url":"https://github.com/CleverTap.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/CleverTap/clevertap-ios-sdk/blob/master/docs/images/clevertap-logo.png\" width = \"50%\"/\u003e\n\u003c/p\u003e\n\n# CleverTap Segment Swift SDK\nCleverTap destination plugin for Segment Swift Analytics.\n\n## Installation\n- In Xcode, navigate to **File -\u003e Swift Package Manager -\u003e Add Package Dependency.**\n- Enter **https://github.com/CleverTap/clevertap-segment-swift.git** when choosing package repo and Click **Next.**\n- On the next screen, Select an SDK version (by default, Xcode selects the latest stable version). Click **Next.**\n- Click **Finish** and ensure that the `SegmentCleverTap` has been added to the appropriate target.\n\n## Quick Start\n```swift\nimport Segment\nimport SegmentCleverTap\n\nlet analytics = Analytics(configuration: Configuration(writeKey: \"YOUR_WRITE_KEY_HERE\"))\nanalytics.add(plugin: CleverTapDestination())\n```\nRefer [Sample App](ExampleSPM) for more details.\n\n## Usage\n### 1. Record User Information\nSegment's `identify` API is mapped to CleverTap's `onUserLogin`.\n```swift\nlet floatAttribute = 12.3\nlet integerAttribute: Int = 18\nlet shortAttribute: Int16 = 2\nlet birthdate: Date = Date(timeIntervalSince1970: 946684800) // 1 Jan 2000\nlet traits: [String: Any] = [\n    \"email\": \"support@clevertap.com\",\n    \"bool\": true,\n    \"double\": 3.14159,\n    \"stringInt\": \"1\",\n    \"integerAttribute\": integerAttribute,\n    \"floatAttribute\": floatAttribute,\n    \"shortAttribute\": shortAttribute,\n    \"gender\": \"female\",\n    \"name\": \"Segment CleverTap\",\n    \"phone\": \"+15555555556\",\n    \"birthday\": birthdate,\n    \"testArr\": [\"1\", \"2\", \"3\"],\n    \"address\": [\n        \"city\": \"New York\",\n        \"country\": \"US\"\n    ]\n]\nanalytics.identify(userId: \"cleverTapSegmentSwiftUseriOS\", traits: traits)\n```\nYou can also use the Segment's `alias` method for user identification:\n\n```swift\nanalytics.alias(newId: \"new_id\")\n```\n\n### 2. Record an Event\nSegment's `track` API is mapped to CleverTap's `recordEvent`.\n\n```swift\nlet properties: [String: Any] = [\n    \"eventproperty\": \"eventPropertyValue\",\n    \"testPlan\": \"Pro\",\n    \"testEvArr\": [1, 2, 3]\n]\nanalytics.track(name: \"testEvent\", properties: properties)\n```\n\n### 3. Record a Charged Event\nEvents tracked using the name `Order Completed` is mapped to CleverTap’s `Charged` event.\n```swift\nlet orderProperties: [String: Any] = [\n    \"checkout_id\": \"fksdjfsdjfisjf9sdfjsd9f\",\n    \"order_id\": \"50314b8e9bcf000000000000\",\n    \"affiliation\": \"Google Store\",\n    \"total\": 30,\n    \"revenue\": 25,\n    \"currency\": \"USD\",\n    \"products\": [\n        [\n            \"product_id\": \"507f1f77bcf86cd799439011\",\n            \"sku\": \"45790-32\",\n            \"name\": \"Monopoly: 3rd Edition\",\n            \"price\": 19,\n            \"quantity\": 1,\n            \"category\": \"Games\"\n        ],\n        [\n            \"product_id\": \"505bd76785ebb509fc183733\",\n            \"sku\": \"46493-32\",\n            \"name\": \"Uno Card Game\",\n            \"price\": 3,\n            \"quantity\": 2,\n            \"category\": \"Games\"\n        ]\n    ]\n]\nanalytics.track(name: \"Order Completed\", properties: orderProperties)\n```\n\n### 4. Record Screen\nSegment's `screen` API is mapped to CleverTap's `recordScreenView`.\n\n```swift\nanalytics.screen(title: \"Test Screen\")\n```\n\n### 5. CleverTap Specific Features\nAccess CleverTap-specific features through the CleverTap instance\n\nRefer to the CleverTap SDK [documentation](https://developer.clevertap.com/docs/ios) for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fclevertap-segment-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevertap%2Fclevertap-segment-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fclevertap-segment-swift/lists"}