SDKs & Framework Integrations

ZTLayer provides fully-typed, officially supported SDKs for major backend frameworks. These SDKs are maintained by the ZTLayer core team and are designed to integrate seamlessly into your application's middleware pipeline.

By using an official SDK, you benefit from:

  • Automatic Threat Parsing: SDKs automatically extract the client IP, User-Agent, and request payload to send to the ZTLayer Edge.
  • Zero-Latency Failover: Built-in exponential backoff and fail-open fallback mechanisms guarantee your app stays online even during catastrophic network events.
  • Action Handling: The SDKs automatically handle the Edge response (e.g., silently dropping the request, throwing an exception, or returning an HTTP 403).

Official Server-Side SDKs

Select your backend framework below for detailed, step-by-step installation instructions, configuration options, and copy-paste production code.

Node.js Ecosystem

PHP Ecosystem

Python Ecosystem

Other Languages


Client-Side Libraries

While ZTLayer is primarily a backend security middleware, we provide client-side libraries specifically for capturing Behavioral Biometrics (mouse movements, touch dynamics, typing cadence).


CMS Integrations

If you are not building a custom application, ZTLayer offers plug-and-play integrations for popular Content Management Systems.


General SDK Architecture

If you are building an integration for an unsupported framework, all ZTLayer SDKs follow this standard architectural flow:

  1. Ingest: The middleware intercepts the HTTP Request.
  2. Package: The request method, URL, headers, and body are serialized.
  3. Dispatch: A fast, asynchronous HTTP POST is made to https://edge.ztlayer.online/v1/verify.
  4. Enforce:
    • If action === 'allow', call next().
    • If action === 'block', terminate the request and return HTTP 403.
    • If action === 'challenge', redirect the user to the ZTLayer CAPTCHA portal.

For details on building a custom integration, refer to the REST API Reference.