SDK Integration
Integrate OK!Gotcha directly into your application code using our SDK
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.
Getting Started
Initialize the SDK
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:
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:
Advanced SDK Features
Check Approval Status
You can check the status of an approval request:
Cancel Pending Approvals
You can cancel a pending approval request:
Webhook Notifications
Configure webhooks to receive real-time updates about approval status changes:
Next Steps
- Learn about the MCP Integration option for LLM frameworks
- Explore Audit Trails for logging and compliance
- Set up Notifications for approval requests