pub struct SupabaseConfig {
pub url: String,
pub api_key: String,
pub jwt: Option<String>,
pub schema: String,
pub timeout: Duration,
pub headers: Vec<(String, String)>,
pub auto_refresh_token: bool,
pub persist_session: bool,
}Expand description
Configuration options for the Supabase client.
Fields§
§url: StringThe Supabase project URL (e.g., https://xyzcompany.supabase.co)
api_key: StringThe Supabase API key (anon key or service role key)
jwt: Option<String>Optional JWT for authenticated requests
schema: StringCustom schema (default: “public”)
timeout: DurationRequest timeout
headers: Vec<(String, String)>Custom headers to include in all requests
auto_refresh_token: boolAuto-refresh token settings
persist_session: boolPersist session
Implementations§
Source§impl SupabaseConfig
impl SupabaseConfig
Sourcepub fn new(url: impl Into<String>, api_key: impl Into<String>) -> Self
pub fn new(url: impl Into<String>, api_key: impl Into<String>) -> Self
Create a new configuration with the given URL and API key.
Sourcepub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a custom header.
Sourcepub fn auto_refresh_token(self, enabled: bool) -> Self
pub fn auto_refresh_token(self, enabled: bool) -> Self
Disable auto-refresh token.
Sourcepub fn persist_session(self, enabled: bool) -> Self
pub fn persist_session(self, enabled: bool) -> Self
Disable session persistence.
Sourcepub fn storage_url(&self) -> String
pub fn storage_url(&self) -> String
Get the Storage API URL.
Sourcepub fn realtime_url(&self) -> String
pub fn realtime_url(&self) -> String
Get the Realtime URL.
Sourcepub fn functions_url(&self) -> String
pub fn functions_url(&self) -> String
Get the Functions URL.
Trait Implementations§
Source§impl Clone for SupabaseConfig
impl Clone for SupabaseConfig
Source§fn clone(&self) -> SupabaseConfig
fn clone(&self) -> SupabaseConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SupabaseConfig
impl RefUnwindSafe for SupabaseConfig
impl Send for SupabaseConfig
impl Sync for SupabaseConfig
impl Unpin for SupabaseConfig
impl UnwindSafe for SupabaseConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more