Skip to main content
The AutumnProvider component is used to wrap your React application and provides the autumnHandler with the customer ID.

Properties

getBearerToken
() => Promise<string | null>
Optional function that returns a bearer token for authenticated requests. Use this when you need to pass the user’s auth token in the Authorization header to your backend (e.g., Clerk, Supabase).
headers
Record<string, string>
Additional HTTP headers to send with each request, which can be accessed in the autumnHandler (e.g., for custom authentication flows).
backendUrl
string
Optional absolute URL for your backend endpoint. Set this when your backend is hosted on a separate domain (e.g., when using Vite with a custom server).
customerData
CustomerData
Optional object containing additional metadata about the current customer, such as email or name.
includeCredentials
boolean
If true, passes credentials in fetch requests to the backend (e.g., cookies, HTTP auth). Autumn will warn you in the console if this is needed.
betterAuthUrl
string
URL for use with the better-auth plugin.