TelemetryDeck/SwiftSDK
TelemetryDeck/SwiftSDK has 229 GitHub stars and 49 forks. Star changes are not measured yet. Last checked 2026-11-14 02:23 UTC. Last push 2026-11-03.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
데이터README.md
OriginalSwift SDK for TelemetryDeck
This package allows you to send signals to TelemetryDeck from your Swift code. Sign up for a free account at telemetrydeck.com
Installation
The easiest way to install TelemetryDeck is using Swift Package Manager, Apple's solution which is built into Xcode. In Xcode, press File > Add Packages..., then in the resulting window enter https://github.com/TelemetryDeck/SwiftSDK into the search field. Set the Dependency Rule field to Up to Next Major Version, then press the Add Package button. Xcode will download it, then you can choose which target of your app to add the "TelemetryDeck" library to (note that "TelemetryClient" is the old name of the lib).
See our detailed setup guide for more information.
Initialization
Init the Telemetry Manager at app startup, so it knows your App ID (you can retrieve the App ID from your TelemetryDeck Dashboard under Set Up App)
let config = TelemetryDeck.Config(appID: "<YOUR-APP-ID>")
// optional: modify the config here
TelemetryDeck.initialize(config: config)
For example, if you're building a scene based app, in the init() function for your App:
import SwiftUI
import TelemetryDeck
@main
struct TelemetryTestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
init() {
// Note: Do not add this code to `WindowGroup.onAppear`, which will be called
// *after* your window has been initialized, and might lead to our initialization
// occurring too late.
let config = TelemetryDeck.Config(appID: "<YOUR-APP-ID>")
TelemetryDeck.initialize(config: config)
}
}
Then send signals like so:
TelemetryDeck.signal("App.launchedRegularly")
Debug -> Test Mode
If your app's build configuration is set to "Debug", all signals sent will be marked as testing signals. In the Telemetry Viewer app, activate Test Mode to see those.
If you want to manually control whether test mode is active, you can set the config.testMode property.
User Identifiers
Telemetry Manager will create a user identifier for you user that is specific to app installation and device. If you have a better user identifier available, such as an email address or a username, you can use that instead, by passing it on to the TelemetryDeck.Config (the identifier will be hashed before sending it).
config.defaultUser = "[email protected]"
You can update the configuration after TelemetryDeck is already initialized.
Parameters
You can also send additional parameters with each signal:
TelemetryDeck.signal("Database.updated", parameters: ["numberOfDatabaseEntries": "3831"])
TelemetryDeck will automatically send base parameters, expand to see common examples
- TelemetryDeck.Accessibility.isBoldTextEnabled
- TelemetryDeck.Accessibility.preferredContentSizeCategory
- TelemetryDeck.AppInfo.buildNumber
- TelemetryDeck.AppInfo.version
- TelemetryDeck.Device.architecture
- TelemetryDeck.Device.modelName
- TelemetryDeck.Device.operatingSystem
- TelemetryDeck.Device.orientation
- TelemetryDeck.Device.platform
- TelemetryDeck.Device.screenResolutionHeight
- TelemetryDeck.Device.screenResolutionWidth
- TelemetryDeck.Device.systemMajorMinorVersion
- TelemetryDeck.Device.systemMajorVersion
- TelemetryDeck.Device.systemVersion
- TelemetryDeck.Device.timeZone
- TelemetryDeck.RunContext.isAppStore
- TelemetryDeck.RunContext.isDebug
- TelemetryDeck.RunContext.isSimulator
- TelemetryDeck.RunContext.isTestFlight
- TelemetryDeck.RunContext.language
- TelemetryDeck.RunContext.targetEnvironment
- TelemetryDeck.SDK.version
- TelemetryDeck.UserPreference.colorScheme
- TelemetryDeck.UserPreference.language
- TelemetryDeck.UserPreference.layoutDirection
- TelemetryDeck.UserPreference.region
See our related documentation page for a full list.
Sessions
With each Signal, the client sends a hash of your user ID as well as a session ID. This gets automatically generated when the client is initialized, so if you do nothing, you'll get a new session each time your app is started from cold storage.
On iOS, tvOS, and watchOS, the session identifier will automatically update whenever your app returns from background, or if it is launched from cold storage. On other platforms, a new identifier will be generated each time your app launches. If you'd like more fine-grained session support, write a new random session identifier into the TelemetryDeck.Config's sessionID property each time a new session begins.
Custom Salt
By default, user identifiers are hashed by the TelemetryDeck SDK, and then sent to the Ingestion API, where we'll add a salt to the received identifier and hash it again.
This is enough for most use cases, but if you want to extra privacy conscious, you can add in you own salt on the client side. The TelemetryDeck SDK will append the salt to all user identifers before hashing them and sending them to us.
If you'd like to use a custom salt, you can do so by passing it on to the TelemetryDeck.Config
let config = TelemetryDeck.Config(appID: "<YOUR-APP-ID>", salt: "<A RANDOM STRING>")
Custom Server
A very small subset of our customers will want to use a custom signal ingestion server or a custom proxy server. To do so, you can pass the URL of the custom server to the TelemetryDeck.Config:
let config = TelemetryDeck.Config(appID: "<YOUR-APP-ID>", baseURL: "https://nom.telemetrydeck.com")
Custom Logging Strategy
By default, some logs helpful for monitoring TelemetryDeck are printed out to the console. This behaviour can be customised by overriding config.logHandler. This struct accepts a minimum allows log level (any log with the same or higher log level will be accepted) and a closure.
This allows for compatibility with other logging solutions, such as swift-log, by providing your own closure.
Developing this SDK
Your PRs on TelemetryDeck's Swift SDK are very much welcome. Check out the SwiftClientTester project, which provides a harness you can use to work on the library and try out new things.
When making a new release, run ./tag-release.sh MAJOR.MINOR.PATCH to bump the version string in the SDK, create a new commit and tag that commit accordingly all in one step.
The project includes a Makefile at the root with some useful commands:
build: Build the librarylint: Applies all auto-correctable lint issues and reformats all source filestest: Run unit tests
Before finalising your PR, please run make lint.
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,711 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,894 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,490 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,522 스타