Home / Companies / WorkOS / Blog / Post Details
Content Deep Dive

Calling the WorkOS API from server-side Swift

Blog post from WorkOS

Post Details
Company
Date Published
Author
Maria Paktiti
Word Count
656
Company Posts That Month
60
Language
English
Hacker News Points
-
Post removed?
No
Summary

WorkOS offers two iOS SDK clients for separate environments: PublicClient supports native mobile authentication using only a client ID, while WorkOSClient is intended for trusted Swift server processes such as Vapor applications, AWS Lambda functions, or shared API packages. WorkOSClient requires an API key that must remain server-side and provides typed asynchronous access to WorkOS resources including organizations, users, and directories, reducing the need to manually construct JSON requests or parse responses. The SDK supplies structured errors containing HTTP status, machine-readable codes, messages, request IDs, and field-level validation details, while automatically retrying transient failures such as timeouts, rate limits, and server errors without retrying genuine client errors. Its list endpoints use AsyncSequence to handle cursor-based pagination through `for try await` iteration, hiding the underlying page requests and cursor management. Together, the clients separate mobile sign-in from server-side resource management, enabling apps to authenticate users locally while securely handling WorkOS API operations on controlled backend infrastructure.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Serverless 1 1,220 277 100 +43%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.