SDK, CLI, and MCP
These tools wrap the RefKit REST API. They are optional.
JavaScript SDK
Install:
npm install @refkitnet/sdkServer exports:
captureClickidentifyCustomerreportPaymentreportRefundreportDispute
Use server capture when possible. The browser fallback is available from @refkitnet/sdk/browser:
import { init, capture, getClickId } from "@refkitnet/sdk/browser";
init();
await capture();
const clickId = getClickId();Browser capture is public and must not receive an App API key.
Managed provider backends using managed revenue keys can pass attributionEvidence to identifyCustomer for direct promotion-code attribution. Ordinary App keys must pass clickId. The evidence includes the applied code, Program ID, and Program Affiliate ID. Prefer clickId whenever one is available; RefKit never synthesizes a click for code attribution.
CLI
Run without installing:
auth loginsigns in through device authorization.initcreates or reuses credentials and prints integration steps.statusreads the App setup checklist.
The CLI also manages Apps, Programs, affiliates, links, commissions, outgoing webhooks, and payouts. Link commands accept --affiliate-id for Developer-managed Affiliate links, and links update changes their labels or UTM fields. refkitnet payouts dispatch sends a prepared batch to an external payout system. Execution fetch and result commands require --api-key or REFKIT_API_KEY with a live key scoped to the exact App.
Every CLI help screen links back to this Help Center:
RefKit MCP
The MCP server lets supported agents inspect and manage RefKit through tools.
First sign in:
Then add the server to the agent's MCP configuration:
The MCP uses the CLI session stored in ~/.refkitnet/config.json. Affiliate tools can instead use REFKIT_AFFILIATE_KEY with an rk_aff_* key.
Set REFKIT_API_KEY to an App-scoped Test or Live key for report_payment, report_refund, and report_dispute. The same variable must contain a live key for payout execution tools.
Developer-managed Affiliate link tools are list_owned_affiliate_links, create_owned_affiliate_link, update_owned_affiliate_link, and delete_owned_affiliate_link.
With the default Cloud origin, get_help returns the matching RefKit Help Center URL. With a custom origin, it returns operator-documentation guidance and no RefKit Cloud URL.
Common agent workflow:
Check authentication.
Call
get_helpwith the closest topic and open the returned Help Center page.Create or inspect App credentials.
Implement the REST integration in the Customer App.
Read setup status to verify the flow.
Keep implementation details in the Customer App's codebase. Use MCP for RefKit resources and status, not as a replacement for the runtime integration.
Last updated
