integration-swift

Skill for integrating PostHog into Swift iOS and macOS applications to assist with tasks related to that integration.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "integration-swift" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d09a748e7da1cccece57088ab1a8af01bc1f204fad7b2fb3c497c7e840dae639. Verify the upstream source and version against https://skills.sh/posthog/skills/integration-swift before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skills.sh

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Skill for integrating PostHog into Swift iOS and macOS applications to assist with tasks related to that integration.

0 Downloads

Introduction source: third_party · posthog · 1.0.0 Reference

SkillPi interpretation

Tasks
PostHog integration for Swift iOS and macOS applications
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: integration-swift
description: PostHog integration for Swift iOS and macOS applications
metadata:
  author: PostHog
  version: 1.9.4

PostHog integration for Swift (iOS/macOS)

This skill helps you add PostHog analytics to Swift (iOS/macOS) applications.

Workflow

Follow these steps in order to complete the integration:

  1. basic-integration-1.0-begin.md - PostHog Setup - Begin ← Start here
  2. basic-integration-1.1-edit.md - PostHog Setup - Edit
  3. basic-integration-1.2-revise.md - PostHog Setup - Revise
  4. basic-integration-1.3-conclude.md - PostHog Setup - Conclusion

Reference files

  • references/EXAMPLE.md - Swift (iOS/macOS) example project code
  • references/ios.md - Ios - docs
  • references/identify-users.md - Identify users - docs
  • references/basic-integration-1.0-begin.md - PostHog setup - begin
  • references/basic-integration-1.1-edit.md - PostHog setup - edit
  • references/basic-integration-1.2-revise.md - PostHog setup - revise
  • references/basic-integration-1.3-conclude.md - PostHog setup - conclusion

The example project shows the target implementation pattern. Consult the documentation for API details.

Key principles

  • Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
  • Minimal changes: Add PostHog code alongside existing integrations. Don't replace or restructure existing code.
  • Match the example: Your implementation should follow the example project's patterns as closely as possible.

Framework guidelines

  • Read configuration from environment variables via a PostHogEnv enum with a value computed property that calls ProcessInfo.processInfo.environment[rawValue] and fatalErrors if missing — cases should be projectToken = "POSTHOG_PROJECT_TOKEN" and host = "POSTHOG_HOST", set in the Xcode scheme's Run environment variables
  • When adding SPM dependencies to project.pbxproj, create three distinct objects with unique UUIDs — a PBXBuildFile (with productRef), an XCSwiftPackageProductDependency (with package and productName), and an XCRemoteSwiftPackageReference (with repositoryURL and requirement). The build file goes in the Frameworks phase files, the product dependency goes in the target's packageProductDependencies, and the package reference goes in the project's packageReferences.
  • Check the latest release version of posthog-ios at https://github.com/PostHog/posthog-ios/releases before setting the minimumVersion in the SPM package reference — do not hardcode a stale version
  • If the project uses App Sandbox (macOS), add ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES to the target's build settings so PostHog can reach its servers — do NOT disable the sandbox entirely

Identifying users

Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID headers to maintain correlation.

Error tracking

Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供 Swift iOS/macOS 应用集成 PostHog 的完整工作流
  • 包含具体步骤、参考文件和框架指南,解决开发者实际集成需求
Trigger Precision95/100

Highlights

  • description 明确描述功能,触发词精准完整,边界清晰
Structure and Standards90/100

Highlights

  • Phase/步骤清晰,有出口条件,包含端到端示例引用
  • frontmatter 完整,单文件未超500行
Execution Reliability80/100

Areas to improve

  • 缺少网络连接失败的异常处理 Reported severity: Minor

    未提及网络连接失败时的异常处理机制

    Recommendation: 建议添加网络连接失败的异常处理说明

Highlights

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制,检查最新版本
Evidence Verifiability (mean of the first four)85/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.