SDK Overview
The OK!Gotcha SDK provides a direct integration path for adding human approval workflows to your applications. It offers fine-grained control over approval processes and seamlessly integrates with your existing code.- TypeScript
- Python
Getting Started
Initialize the SDK
- TypeScript
- Python
We recommend storing your API key in environment variables rather than hardcoding it in your application.
Add Approval to Functions
The core functionality of OK!Gotcha is to add approval requirements to your functions:- TypeScript
- Python
When a function is wrapped with
requireApproval
, it will not execute immediately. Instead, it creates an approval request and returns a promise/future that resolves when approval is granted.Handling Approval Results
There are multiple ways to handle the results of approval-required functions:- Async/Await (TypeScript)
- Promise Chaining (TypeScript)
- Python
Advanced SDK Features
Check Approval Status
You can check the status of an approval request:- TypeScript
- Python
Cancel Pending Approvals
You can cancel a pending approval request:- TypeScript
- Python
Webhook Notifications
Configure webhooks to receive real-time updates about approval status changes:- TypeScript
- Python
Next Steps
- Learn about the MCP Integration option for LLM frameworks
- Explore Audit Trails for logging and compliance
- Set up Notifications for approval requests