Developer tools
Migration guides
Java 1.0

Java SDK upgrade (v0.x to v1.0)

Learn how to upgrade to v1.0 of the Knock Java SDK.

Basic changes

#

Client initialization

#

Initialize your client using environment variables or explicit configuration:

What's new in v1.0

#

The v1.0 SDK introduces significant improvements for Java developers, including async support, immutable objects, and better error handling.

Asynchronous execution

#

Switch to asynchronous operations when needed:

Immutable objects

#

All objects are immutable for thread safety:

Pagination helpers

#

Work with paginated resources more easily:

Raw response access

#

Access raw HTTP responses when needed:

Enhanced error handling

#

Handle errors more efficiently with more detailed error 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.

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

#

Old SDK:

New SDK:

Old SDK:

New SDK:

Old SDK:

New SDK:

Old SDK:

New SDK:

Need help?

#

If you run into any issues during your migration, reach out to our support team or open an issue on GitHub.