customize-sdk-hooks

Implement custom code hooks in Speakeasy-generated SDKs for lifecycle events.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/berea-ch/bereach-sdk-ts --skill customize-sdk-hooks-berea-ch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: customize-sdk-hooks
Source: https://github.com/berea-ch/bereach-sdk-ts/tree/main/.agents/skills/customize-sdk-hooks
Command: npx skills add https://github.com/berea-ch/bereach-sdk-ts --skill customize-sdk-hooks-berea-ch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to seamlessly integrate custom code logic into generated SDKs, enhancing functionality beyond the default API specifications.

Core Features & Use Cases

  • Custom Request/Response Handling: Modify requests before they are sent or responses after they are received.
  • Enhanced Security: Implement custom authentication like HMAC signing or add custom headers.
  • Telemetry & Logging: Integrate application-level telemetry or detailed logging within the SDK's lifecycle.
  • Use Case: You need to add a unique correlation ID to every request made by your SDK for better traceability in your distributed systems.

Quick Start

Use the customize-sdk-hooks skill to add a custom User-Agent header to all outgoing requests in your TypeScript SDK.

Frequently Asked Questions about customize-sdk-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom headers to SDK requests?

Custom headers are added to SDK requests by implementing hooks for the BeforeRequest lifecycle event, allowing you to inject custom logic and modify outgoing HTTP requests before they are dispatched.

What are SDK lifecycle hooks used for?

SDK lifecycle hooks are used to inject custom logic into generated SDKs for advanced processing. They support events like BeforeRequest, AfterSuccess, and AfterError to facilitate telemetry, HMAC signing, and request or response transformation.

Can I implement HMAC signing within a generated TypeScript SDK?

Yes, you can implement HMAC signing within a generated TypeScript SDK. By utilizing the BeforeRequest hook, you can inject custom authentication logic and compute signatures directly before the request is sent.

Does this SDK customization approach support Go and Python?

Yes, this SDK customization approach supports Go and Python. It integrates with Speakeasy-generated SDKs across multiple languages, including TypeScript, Go, Python, and Java, for comprehensive lifecycle management.

How do I collect telemetry data after an API request fails?

You collect telemetry data after an API request fails by implementing a custom code hook for the AfterError lifecycle event. This captures error details within the generated SDK for enhanced logging and traceability.