Configuration
initializeSDK(config)
Initialize the SDK with your credentials and configuration.
To get config, use the getConfig()
method.
To update config, use the updateConfig()
method. You can update one or more parameters mentioned in the Configuration Parameters section.
Configuration Parameters
apiKey
(required)
Your unique API key for authentication with the Blockend API
Must be obtained through the Blockend platform
Used to track API usage and enforce rate limits
integratorId
(required)
A unique identifier for your integration/application
Used for analytics, tracking, and support purposes
Helps identify your specific implementation when interacting with Blockend services
errorHandler
(optional)
A callback function to handle SDK errors globally
Receives a
BlockendError
object with properties:message
: Description of the errorcode
: Error code (e.g., "CONFIGURATION_ERROR", "NETWORK_ERROR", "VALIDATION_ERROR")data
: Additional error context (if available)
Useful for centralized error handling, logging, and error reporting
Example usage:
baseURL
(optional)
The base URL endpoint for the Blockend API
Defaults to
https://api2.blockend.com/v1
Can be modified for different environments (staging, testing, etc.)
Should include the version prefix (
/v1
)
enableCache
(optional)
Boolean flag to enable/disable SDK's built-in caching mechanism
When enabled, caches API responses to reduce network requests
Particularly useful for frequently accessed data like token lists and chain information
Defaults to
false
if not specified
cacheTimeout
(optional)
Duration in milliseconds for how long cached items should remain valid
Only applies when
enableCache
istrue
Defaults to 1 hour (3600000 milliseconds)
Can be adjusted based on your application's needs and data freshness requirements
Last updated
Was this helpful?