···3940## Authenticate the User
4142-EffemKit relies on CoreATProtocol for OAuth authentication. Once the user signs in through CoreATProtocol, the PDS host is automatically available and ``EffemRepoService`` can write records:
4344```swift
45-// After CoreATProtocol OAuth flow completes,
46-// APEnvironment.current.host is set to the user's PDS.
47-// No additional EffemKit configuration is needed for writes.
000000000000048```
00004950## Read Data with EffemService
51
···3940## Authenticate the User
4142+EffemKit re-exports CoreATProtocol's OAuth types under `Effem*` names so you only need `import EffemKit`. Create an ``EffemOAuth`` instance, configure it, and run the authentication flow:
4344```swift
45+import EffemKit
46+47+@APActor
48+func signIn(presentURL: @escaping (URL) async -> URL) async throws -> EffemAuthResult {
49+ let config = EffemOAuthConfig(
50+ clientMetadataURL: "https://effem.xyz/client-metadata.json",
51+ redirectURI: "effem://oauth/callback",
52+ scopes: ["atproto", "transition:generic"]
53+ )
54+55+ let oauth = EffemOAuth(config: config)
56+ return try await oauth.authenticate(
57+ identifier: "alice.bsky.social",
58+ authenticator: presentURL
59+ )
60+}
61```
62+63+After authentication succeeds, CoreATProtocol's `APEnvironment` is automatically configured with the user's PDS host, access token, and DPoP keys. ``EffemRepoService`` can immediately write records — no additional setup needed.
64+65+For a full walkthrough of the OAuth flow, token refresh, and session persistence, see <doc:Authentication>.
6667## Read Data with EffemService
68