///
The Quicksilver SDK provides flexible configuration options to connect to different environments and customize client behavior. This page details how to initialize the `QuicksilverClient` and explains
38 views
~38 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
The Quicksilver SDK provides flexible configuration options to connect to different environments and customize client behavior. This page details how to initialize the QuicksilverClient and explains the available ClientOptions.
To start using the SDK, you need to instantiate the QuicksilverClient with your API key and an optional ClientOptions object.
The first argument to the QuicksilverClient constructor is your API Key. This key is essential for authenticating your requests with the Quicksilver Engine. You can obtain your API key by signing up at quicksilver.com↗.
Important: Never expose your API key in client-side code or public repositories. Use environment variables or a secure configuration management system.
The ClientOptions interface (src/client.ts) allows you to customize various aspects of the SDK's behavior:
env?: 'production' | 'sandbox'This option specifies the API environment the SDK should connect to.
'production' (Default): Connects to the live Quicksilver API. The default base URL for this environment is https://api.quicksilver.com.'sandbox': Connects to the sandbox environment, ideal for development and testing. The default base URL for this environment is http://localhost:3000 (assuming a local sandbox instance is running).Example: Initializing for the Sandbox Environment
baseURL?: stringThis option allows you to explicitly override the API's base URL. This is useful if you are running a custom Quicksilver Engine instance, or if the default sandbox/production URLs change.
Note: If baseURL is provided, it will take precedence over the env setting for determining the base URL.
Example: Overriding the Base URL
timeout?: numberThis option sets the maximum time (in milliseconds) the SDK will wait for an API response before aborting the request.
30000 milliseconds (30 seconds).Example: Setting a Custom Timeout
By understanding and utilizing these configuration options, you can effectively manage your Quicksilver SDK integration across various environments and performance requirements.