SvrfClient
SvrfClient
Create a new SvrfClient instance. When creating a new instance, the library will automatically authenticate your Svrf API Key.
Options
Options can be provided as ApiOptions
instance to adjust the API client's settings.
Manual Authentication
If you want to postpone the initial authentication request and manually control when the Svrf API Key is authenticated, you can set ApiOptions.IsManualAuthentication
property to true
. Then call AuthenticateAsync()
method of the client instance to authenticate the Svrf API Key.
Authentication Tokens
The library will automatically handle attaching your Authentication Token to your requests' headers and renew expired tokens.
Custom Token Storage
Authentication tokens will be automatically saved in memory. Optionally, you can provide your own custom token storage methods using the ApiOptions.Storage
property. Provided storage should implement ITokenStorage
interface.
Syntax
using Svrf;using Svrf.Models;var options = new ApiOptions { IsManualAuthentication = false };var svrf = new SvrfClient("your key", options);
Parameters
Parameter | Type | Description |
---|---|---|
apiKey | string | Your Svrf API Key. |
options | ApiOptions | Advanced API client options. |
options.IsManualAuthentication | bool? | Trigger the authentication of your Svrf API Key manually. Defaults: false . |
options.Storage | ITokenStorage | Use custom methods to Get , Set , and Clear the authentication token. If none is provided, the application will use default in-memory storage. |