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

#
  1. Asynchronous Execution: Easily switch to asynchronous operations

  2. Immutable Objects: All objects are immutable for thread safety

  3. Pagination Helpers: Easily work with paginated resources

  4. Raw Response Access: Work with raw HTTP responses when needed

  5. Enhanced Error Handling: Better error types with detailed information

  6. Additional Properties: Add undocumented parameters when needed

Breaking Changes

#
  1. Request Parameter Style:

    • The new SDK uses builder patterns for all request parameters
    • Parameters are grouped into structured objects rather than flat lists
  2. Method Signatures:

    • Most methods now take parameter objects instead of individual parameters
    • The new SDK uses a more consistent naming convention across all methods
  3. 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
  4. Error Handling:

    • The new SDK provides more detailed and structured error information
  5. 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.