Skip to content

Commit 901e390

Browse files
committed
JSON keys
1 parent 709949f commit 901e390

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

Sources/LiveKit/Auth/ConnectionCredentials.swift

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ public enum ConnectionCredentials {
3737
/// - SeeAlso: [Room Configuration Documentation](https://docs.livekit.io/home/get-started/authentication/#room-configuration) for more info.
3838
let roomConfiguration: RoomConfiguration?
3939

40+
// enum CodingKeys: String, CodingKey {
41+
// case roomName = "room_name"
42+
// case participantName = "participant_name"
43+
// case participantIdentity = "participant_identity"
44+
// case participantMetadata = "participant_metadata"
45+
// case participantAttributes = "participant_attributes"
46+
// case roomConfiguration = "room_configuration"
47+
// }
48+
4049
public init(
4150
roomName: String? = nil,
4251
participantName: String? = nil,
@@ -57,12 +66,17 @@ public enum ConnectionCredentials {
5766
/// Response containing the credentials needed to connect to a room.
5867
public struct Response: Decodable, Sendable {
5968
/// The WebSocket URL for the LiveKit server.
60-
let serverUrl: URL
69+
let serverURL: URL
6170
/// The JWT token containing participant permissions and metadata.
6271
let participantToken: String
6372

64-
public init(serverUrl: URL, participantToken: String) {
65-
self.serverUrl = serverUrl
73+
// enum CodingKeys: String, CodingKey {
74+
// case serverURL = "server_url"
75+
// case participantToken = "participant_token"
76+
// }
77+
78+
public init(serverURL: URL, participantToken: String) {
79+
self.serverURL = serverURL
6680
self.participantToken = participantToken
6781
}
6882
}

Sources/LiveKit/Core/Room.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
414414
roomOptions: RoomOptions? = nil) async throws
415415
{
416416
let credentials = try await credentialsProvider.fetch(credentialsOptions)
417-
try await connect(url: credentials.serverUrl.absoluteString, token: credentials.participantToken, connectOptions: connectOptions, roomOptions: roomOptions)
417+
try await connect(url: credentials.serverURL.absoluteString, token: credentials.participantToken, connectOptions: connectOptions, roomOptions: roomOptions)
418418
}
419419

420420
@objc

0 commit comments

Comments
 (0)