Authsignal Python SDK 4.0.0
Breaking Changes
Client Initialization
- The client initialization interface has been updated to use named parameters
- `api_secret_key` is now required (previously `api_key`)
- Optional parameters include `api_url` (defaults to "https://api.authsignal.com/v1") and `timeout` (defaults to 2.0 seconds)
SDK Methods
- All methods now use consistent parameter naming and typing
- Added type hints throughout the SDK for better IDE support and code safety
- Requests that require a body expect an `attributes` parameter which needs to be a dictionary of key value pairs, equivalent to the JSON input body. Please use camel case for the keys.
Method Updates
- `track()` now requires `user_id`, `action`, and `attributes` parameters
- `get_user()` now requires `user_id` parameter
- `update_user()` now requires `user_id` and `attributes` parameters
- `delete_user()` now requires `user_id` parameter
- `get_authenticators()` now requires `user_id` parameter
- `enroll_verified_authenticator()` now requires `user_id` and `attributes` parameters
- `delete_authenticator()` now requires `user_id` and `user_authenticator_id` parameters
- `validate_challenge()` now requires `attributes` parameter
- `get_action()` now requires `user_id`, `action`, and `idempotency_key` parameters
- `update_action()` now requires `user_id`, `action`, `idempotency_key`, and `attributes` parameters
Error Handling
- Improved error handling with custom `ApiException` class which is standardized across our SDKs
Migration Guide
If you're upgrading from a previous version, you'll need to:
1. Update your client initialization to use the new parameter names
2. Review all method calls to ensure they include the required parameters
3. Update error handling to work with the new `ApiException` format