Skip to content

Commit 85d24e6

Browse files
committed
Update README
Updated the "Quick Start" instructions to be more accurate.
1 parent 7c7d122 commit 85d24e6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ By default, `ATProtocolConfiguration` conforms to `https://bsky.social`. However
106106
let result = ATProtocolConfiguration(pdsURL: "https://example.social")
107107
```
108108

109-
After that, use the `authenticate()` method, and pass in the handle and password of the user account. Once you've passed in the `ATProtocolConfiguration` object to the `ATProtoKit` `class`, use the `getUserSession()` method. This session contains all of the elements you need, such as the access and refresh tokens:
109+
After that, use the `authenticate()` method, and pass in the handle and password of the user account. Once you've passed in the `ATProtocolConfiguration` object to the `ATProtoKit` `class`, use the `getUserSession()` method, as well as the `ATProtocolConfiguration.sessionConfiguration.keychainProtocol` property. These two contains all of the elements you need, such as the session tokens, decentralized identifier (DID), and service endpoint:
110110
```swift
111111
Task {
112112
do {
@@ -115,9 +115,14 @@ Task {
115115
// The session object is contains in the `ATProtoKit` object:
116116
let atProtoKit = ATProtoKit(ATProtoKit(sessionConfiguration: config)
117117

118-
if let session = atProtoKit.getUserSession() {
119-
print("Result (Access Token): \(session.accessToken)")
120-
print("Result (Refresh Token): \(session.refreshToken)")
118+
if let session = try await atProtoKit.getUserSession() {
119+
print("Result (Service Endpoint): \(session.serviceEndpoint)")
120+
print("Result (DID): \(session.sessionDID)")
121+
}
122+
123+
if let session = try await atProtoKit.getUserSession() {
124+
print("Result (Service Endpoint): \(session.serviceEndpoint)")
125+
print("Result (DID): \(session.sessionDID)")
121126
}
122127
} catch {
123128
print("Error: \(error)")

0 commit comments

Comments
 (0)