SolvaPayConfig
SolvaPay SDK / react/src / SolvaPayConfig
Interface: SolvaPayConfig
Defined in: packages/react/src/types/index.ts:66
SolvaPay Provider Configuration Sensible defaults for minimal code, but fully customizable
Properties
api?
optionalapi:object
Defined in: packages/react/src/types/index.ts:71
API route configuration Defaults to standard Next.js API routes
checkSubscription?
optionalcheckSubscription:string
createPayment?
optionalcreatePayment:string
processPayment?
optionalprocessPayment:string
auth?
optionalauth:object
Defined in: packages/react/src/types/index.ts:81
Authentication configuration Uses adapter pattern for flexible auth provider support
adapter?
optionaladapter:AuthAdapter
Auth adapter instance Default: checks localStorage for 'auth_token' key
Example
import { createSupabaseAuthAdapter } from '@solvapay/react-supabase';
<SolvaPayProvider
config={{
auth: {
adapter: createSupabaseAuthAdapter({
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
})
}
}}
>
getToken()?
optionalgetToken: () =>Promise<string|null>
Returns
Promise<string | null>
Deprecated
Use adapter instead. Will be removed in a future version.
Function to get auth token
getUserId()?
optionalgetUserId: () =>Promise<string|null>
Returns
Promise<string | null>
Deprecated
Use adapter instead. Will be removed in a future version.
Function to get user ID (for cache key)
fetch()?
optionalfetch: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: packages/react/src/types/index.ts:121
Custom fetch implementation Default: uses global fetch
Call Signature
(
input,init?):Promise<Response>
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | Request | URL
init?
RequestInit
Returns
Promise<Response>
headers?
optionalheaders:HeadersInit| () =>Promise<HeadersInit>
Defined in: packages/react/src/types/index.ts:127
Request headers to include in all API calls Default: empty
onError()?
optionalonError: (error,context) =>void
Defined in: packages/react/src/types/index.ts:133
Custom error handler Default: logs to console
Parameters
error
Error
context
string
Returns
void