Overview
TheLimrun class is the primary entry point for interacting with the Limrun API. It provides access to all resource endpoints and handles authentication, retries, timeouts, and logging.
Constructor
Create a new Limrun client instance.Parameters
Configuration options for the client. See Client Options for detailed information.
Properties
Resource Properties
The Limrun client exposes the following resource properties for accessing API endpoints:Access Android instance operations. See Android Instances for available methods.
Access iOS instance operations. See iOS Instances for available methods.
Configuration Properties
The API key used for authentication. Can be
null if using custom authentication headers.The base URL for API requests. Defaults to
https://api.limrun.com.Maximum number of retry attempts for failed requests. Defaults to
2.Request timeout in milliseconds. Defaults to
300000 (5 minutes).The logger instance used for logging. Defaults to
console.The current log level. Can be
'debug', 'info', 'warn', or 'error'.Additional fetch options passed to all requests.
HTTP Methods
The Limrun client provides low-level HTTP methods for making custom API requests. These methods are primarily used internally by resource classes but can be used directly for custom integrations.get()
Make a GET request.The API endpoint path (e.g.,
/v1/android_instances).Additional request options including query parameters, headers, and timeout overrides.
post()
Make a POST request.The API endpoint path.
Request options including body, query parameters, and headers.
patch()
Make a PATCH request.The API endpoint path.
Request options including body, query parameters, and headers.
put()
Make a PUT request.The API endpoint path.
Request options including body, query parameters, and headers.
delete()
Make a DELETE request.The API endpoint path.
Request options including query parameters and headers.
Instance Methods
withOptions()
Create a new client instance with modified options, inheriting all settings from the current client.Options to override in the new client instance.
Limrun instance with the specified options.
Example:
Static Properties
Error Classes
The Limrun class exposes error classes as static properties:Base error class for all Limrun SDK errors.
Error thrown when the API returns an error response.
Error thrown when a connection to the API fails.
Error thrown when a request times out.
Error thrown when a request is aborted by the user.
Error thrown for 404 responses.
Error thrown for 409 conflict responses.
Error thrown when rate limits are exceeded.
Error thrown for 400 bad request responses.
Error thrown for authentication failures.
Error thrown for 500 internal server errors.
Error thrown for 403 permission denied responses.
Error thrown for 422 unprocessable entity responses.
Utility Methods
Constants
Default timeout value in milliseconds. Set to
300000 (5 minutes).Usage Examples
Basic Initialization
With Environment Variables
Custom Configuration
Error Handling
Using Multiple Clients
See Also
- Client Options - Detailed configuration options
- Error Handling - Comprehensive error handling guide
- Authentication - Authentication setup
- Retries & Timeouts - Configuring retry behavior