Conversation
| @@ -0,0 +1,131 @@ | |||
| --- | |||
There was a problem hiding this comment.
Citation: Based on the Swift SDK implementation in sdks/implementations/swift/ and the SDK README (sdks/implementations/swift/README.md) which documents installation, quick start, token storage options, error handling, OAuth flows, and server-side usage patterns. Marked as preview since it publishes to stack-auth/swift-sdk-prerelease.
View source
|
|
||
| ### Simple OAuth (Recommended) | ||
|
|
||
| For most apps, simply use `signInWithOAuth()` — it handles the entire OAuth flow automatically. It uses the `stack-auth://` callback scheme, which works without any additional configuration: |
There was a problem hiding this comment.
Citation: OAuth API changes from PR #1130: signInWithOAuth() now uses fixed stack-auth:// callback scheme, getOAuthUrl() requires explicit redirectUrl and errorRedirectUrl parameters, and callOAuthCallback() requires the redirectUrl parameter. See changes in sdks/spec/src/apps/client-app.spec.md for the spec and sdks/implementations/swift/Sources/StackAuth/StackClientApp.swift for the implementation.
View source
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| 'oauth': [ | ||
| { | ||
| language: 'Swift', |
There was a problem hiding this comment.
Citation: Updated OAuth code examples based on PR #1130. The new API signatures are documented in sdks/implementations/swift/README.md and the spec at sdks/spec/src/apps/client-app.spec.md.
View source
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
Comment |
|
🔧 I noticed that some CI checks failed for this PR. I'm investigating the failures and will work on fixing them. |
1 similar comment
|
🔧 I noticed that some CI checks failed for this PR. I'm investigating the failures and will work on fixing them. |
Greptile OverviewGreptile SummaryThis PR adds comprehensive documentation for the new Swift SDK (Preview), enabling native authentication for iOS, macOS, watchOS, tvOS, and visionOS applications.
The documentation is well-structured, follows existing patterns from other SDK docs, and accurately reflects the OAuth API changes from PR #1130. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant App as Swift App
participant SDK as StackClientApp
participant Browser as ASWebAuthenticationSession
participant OAuth as OAuth Provider
participant Backend as Stack Auth Backend
Note over App,Backend: Simple OAuth Flow (signInWithOAuth)
App->>SDK: signInWithOAuth(provider: "google")
SDK->>Backend: getOAuthUrl(provider, redirectUrl: "stack-auth://")
Backend-->>SDK: {url, state, codeVerifier}
SDK->>Browser: Open OAuth URL
Browser->>OAuth: User authenticates
OAuth->>Browser: Redirect to stack-auth://
Browser-->>SDK: Callback with code
SDK->>Backend: callOAuthCallback(url, codeVerifier, redirectUrl)
Backend-->>SDK: {accessToken, refreshToken}
SDK->>SDK: Store tokens in Keychain
SDK-->>App: Success
Note over App,Backend: Manual OAuth Flow
App->>SDK: getOAuthUrl(provider, redirectUrl, errorRedirectUrl)
SDK->>Backend: Request OAuth URL
Backend-->>SDK: {url, state, codeVerifier, redirectUrl}
SDK-->>App: OAuth details
App->>App: Store state & codeVerifier
App->>Browser: Open oauth.url manually
Browser->>OAuth: User authenticates
OAuth->>Browser: Redirect to custom URL
Browser-->>App: Callback URL
App->>SDK: callOAuthCallback(url, codeVerifier, redirectUrl)
SDK->>Backend: Exchange code for tokens
Backend-->>SDK: {accessToken, refreshToken}
SDK->>SDK: Store tokens
SDK-->>App: Success
|
Open this suggestion in Promptless to view citations and reasoning process
Adds documentation for the new Swift SDK that provides native authentication for iOS, macOS, watchOS, tvOS, and visionOS applications. Creates a comprehensive getting started guide covering installation via Swift Package Manager, sign-up/sign-in flows, token storage options (Keychain, memory, explicit), error handling, OAuth authentication with the
stack-auth://callback scheme, and server-side usage. Updates the setup page to list Swift as a supported platform. The documentation is marked as "Preview" since the SDK publishes to a prerelease repository.Updated for PR #1130: OAuth documentation now reflects the new API requiring explicit
redirectUrlanderrorRedirectUrlparameters for manual OAuth flows, documents the fixedstack-auth://callback scheme used bysignInWithOAuth(), and notes that custom schemes require backend configuration.Trigger Events
stack-auth/stack-auth PR #1117: SDK specs
Promptless Research (1 GitHub PR)
Agent Response
stack-auth/stack-auth PR #1130: [Fix] [Feat] Update OAuth Sign-In and Get Token Functions to Work
Promptless Research (1 GitHub PR)
Agent Response
Help us improve Promptless — If this suggestion missed the mark, please share quick feedback.
If you want Promptless to make further changes on this PR, feel free to leave a comment tagging Promptless (It won't show up in the user drop down but Promptless will get it!)