Developer tools
Migration guides
Java 1.0
Java SDK upgrade (v0.x to v1.0)
This guide will help you upgrade from the previous Knock Java SDK to the new v1.0 Java SDK.
Basic Changes
Client Initialization
New Features in v1.0
-
Asynchronous Execution: Easily switch to asynchronous operations
-
Immutable Objects: All objects are immutable for thread safety
-
Pagination Helpers: Easily work with paginated resources
-
Raw Response Access: Work with raw HTTP responses when needed
-
Enhanced Error Handling: Better error types with detailed information
-
Additional Properties: Add undocumented parameters when needed
Breaking Changes
-
Request Parameter Style:
- The new SDK uses builder patterns for all request parameters
- Parameters are grouped into structured objects rather than flat lists
-
Method Signatures:
- Most methods now take parameter objects instead of individual parameters
- The new SDK uses a more consistent naming convention across all methods
-
Type System:
- The new SDK uses
JsonValue
and typed fields for better type safety - Field access methods have changed to accommodate the new type system
- The new SDK uses
-
Error Handling:
- The new SDK provides more detailed and structured error information
-
API Key Configuration:
- API key is now passed as a bearer token instead of a dedicated API key parameter
Common Operations
Triggering Workflows
Old SDK:
New SDK:
User Preferences
Old SDK:
New SDK:
Identifying Users
Old SDK:
New SDK:
Setting Channel Data
Old SDK:
New SDK:
Support
If you encounter any issues during migration, please reach out to our support team or open an issue on GitHub.