Skip to content

Commit d148faa

Browse files
authored
fix: add init with default options param (#225)
1 parent 148e3dc commit d148faa

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Sources/Supabase/SupabaseClient.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@ public final class SupabaseClient: @unchecked Sendable {
7171
options.global.session
7272
}
7373

74+
#if !os(Linux)
75+
/// Create a new client.
76+
/// - Parameters:
77+
/// - supabaseURL: The unique Supabase URL which is supplied when you create a new project in
78+
/// your project dashboard.
79+
/// - supabaseKey: The unique Supabase Key which is supplied when you create a new project in
80+
/// your project dashboard.
81+
public convenience init(supabaseURL: URL, supabaseKey: String) {
82+
self.init(
83+
supabaseURL: supabaseURL,
84+
supabaseKey: supabaseKey,
85+
options: SupabaseClientOptions()
86+
)
87+
}
88+
#endif
89+
7490
/// Create a new client.
7591
/// - Parameters:
7692
/// - supabaseURL: The unique Supabase URL which is supplied when you create a new project in

Tests/SupabaseTests/SupabaseClientTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,13 @@ final class SupabaseClientTests: XCTestCase {
5151
]
5252
)
5353
}
54+
55+
#if !os(Linux)
56+
func testClientInitWithDefaultOptionsShouldBeAvailableInNonLinux() {
57+
_ = SupabaseClient(
58+
supabaseURL: URL(string: "https://project-ref.supabase.co")!,
59+
supabaseKey: "ANON_KEY"
60+
)
61+
}
62+
#endif
5463
}

0 commit comments

Comments
 (0)