Skip to main content
This guide covers best practices for SDK setup, controller lifecycle management, and common mistakes to avoid.

SDK initialization

Create client once

Create a single client instance and share it across your application. Creating multiple instances wastes resources and breaks caching.

Required configuration

Always provide sorts and facets when creating the client:

Controller lifecycle

Always dispose controllers

Controllers maintain subscriptions and state. Dispose them when components unmount to prevent memory leaks.

Controller reuse

Controllers can be reused for multiple operations:

Filter handling

Use filter DSL for complex filters

For complex filter conditions, use the filter DSL:

Error handling

Handle errors gracefully

Always check for errors in the Result object:

Prepare failures are non-fatal

If prepare fails, execute will still work (but may be slower):

Next steps

Search Patterns

Learn advanced search patterns including prepare/execute flows.

Caching

Understand SDK caching behavior and optimization.