Cowliss
Track an event, send an email
Section titled “Track an event, send an email”-
Install the SDK and create one client with your API key and source id.
Terminal window npm install @cowliss/sdkimport { Cow } from "@cowliss/sdk";const cow = new Cow({apiKey: process.env.COW_KEY!,sourceId: process.env.COW_SOURCE_ID!,}); -
Track what happened. The profile is created on the first call.
await cow.track({event: "order.placed",properties: { orderId: "A-2291", total: 4200 },}); -
Send the receipt. The
fromaddress has to be on a domain your organization verified.const { deliveryId } = await cow.emails.send({subject: "Your receipt for A-2291",html: "<p>Thanks for your order.</p>",});deliveryIdis the delivery that records whether it arrived. To send a template from your repo instead, seeemails.send.
That same order.placed event can start an automation that waits, checks, and emails on its own: the Quickstart builds one.
Add it with your agent
Section titled “Add it with your agent”Paste this into Claude Code, Cursor, or any coding agent working in your repo:
Add Cowliss to this app. Read https://docs.cowliss.com/llms.txt first, thenhttps://docs.cowliss.com/sdk/index.md.
1. Install @cowliss/sdk and create one Cow client, reading the API key from COW_KEY and the source id from COW_SOURCE_ID.2. Call cow.identify when a user signs up or signs in, with their userId and email.3. Call cow.track for the events this app already records (sign-up, purchase, and the like). Keep the event names this app already uses.4. Send transactional email (receipts, password resets) with cow.emails.send instead of the current mail provider, from an address on our verified domain.
Do not await tracking calls on the request path; pass an onError that logs.The commands, if you would rather run them yourself:
npm install @cowliss/sdk # the client your app callsnpm install --save-dev @cowliss/cli # the cow CLInpx cow login # browser sign-in, oncenpx cow init # automations and email templates live in .cowliss/Give the agent the product as tools with the MCP server: add
https://api.cowliss.com/mcp to any MCP client and sign in, or run the full
tool table locally:
claude mcp add cow -- npx -y @cowliss/cli mcpEvery page here is also markdown (append index.md to its URL), the site map is /llms.txt, and the API is /openapi.json. See CLI and MCP for agents.