🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@offerkit/cli

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@offerkit/cli

OfferKit command-line interface.

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

@offerkit/cli

Command-line interface for OfferKit.

OfferKit is open-source promotion infrastructure for coupons, gift cards, loyalty, referrals, customer segments, and validation rules. The CLI uses @offerkit/sdk under the hood and talks to the same /api/v1 API as the dashboard, SDK, and MCP server.

Install

npm install -g @offerkit/cli
pnpm add -g @offerkit/cli

The installed binary is offerkit.

Configure

Mint an API key in the OfferKit dashboard at /settings/api-keys, then save it locally:

offerkit login --url https://your-offerkit-deployment --api-key offerkit_...

This writes ~/.offerkitrc with file mode 0600.

You can also use environment variables:

export OFFERKIT_API_URL=https://your-offerkit-deployment
export OFFERKIT_API_KEY=offerkit_...

Environment variables override values from ~/.offerkitrc.

Inspect the active local configuration without making an API call:

offerkit config

Check the configured deployment and authenticated workspace:

offerkit doctor
offerkit whoami

Commands

Most write-heavy commands accept --data with inline JSON, @file.json, or - to read JSON from stdin. Command output is formatted JSON.

Feature-rich resource commands cover vouchers, campaigns, validation rules, customers, segments, promotion tiers, reward types, referrals, loyalty, webhooks, events, orders, API keys, users, workspace settings, audit log, and insights. The generic api command is available as a fallback for exact SDK procedure calls.

Call any OfferKit API procedure by SDK path:

offerkit api validationRules.create \
  --input '{"name":"WAPP25 min spend","appliesTo":"voucher","rule":{">=":[{"var":"order.amount"},25000]}}'

offerkit api campaigns.create \
  --input '{"name":"WAPP25","type":"DISCOUNT","currency":"EUR","validationRuleId":"<RULE_ID>"}'

offerkit api vouchers.create \
  --input '{"code":"WAPP25","campaignId":"<CAMPAIGN_ID>","type":"DISCOUNT","discount":{"type":"AMOUNT","amount":2500}}'

--input accepts inline JSON, @file.json, or - to read JSON from stdin.

Convenience commands:

offerkit vouchers list
offerkit vouchers list --search SUMMER
offerkit vouchers get SUMMER10
offerkit vouchers create --code WAPP25 --campaign-id <CAMPAIGN_ID> --discount-amount 2500
offerkit vouchers update WAPP25 --data '{"redemptionLimit":1}'
offerkit vouchers bulk --campaign-id <CAMPAIGN_ID> --count 100 --discount-amount 2500
offerkit vouchers validate SUMMER10 --amount 9999 --currency USD
offerkit vouchers redeem SUMMER10 --amount 9999 --currency USD --idempotency-key order-42
offerkit vouchers qualify --data @qualify.json
offerkit vouchers stack-redeem --data @stack-redemption.json
offerkit campaigns list
offerkit campaigns get <CAMPAIGN_ID>
offerkit campaigns create --name "Spring 2026" --type DISCOUNT --currency USD --code-prefix SPRING
offerkit campaigns update <CAMPAIGN_ID> --status active --validation-rule-id <RULE_ID>
offerkit campaigns delete <CAMPAIGN_ID>
offerkit validation-rules list
offerkit validation-rules create \
  --name "Minimum spend" \
  --rule '{">=":[{"var":"order.amount"},25000]}'
offerkit validation-rules update <RULE_ID> --data '{"description":"EUR 250 minimum"}'
offerkit customers list
offerkit customers list --search alice
offerkit customers get 00000000-0000-0000-0000-000000000000
offerkit customers upsert --data '{"externalId":"user_123","email":"alice@example.com"}'
offerkit segments list
offerkit promotions tiers create --data @tier.json
offerkit referrals issue --data @referral.json
offerkit loyalty members earn --data @earn-points.json
offerkit webhooks create --data @webhook.json
offerkit orders create --data @order.json
offerkit api-keys create --data '{"name":"CI","scopes":["*"]}'
  • Repository: https://github.com/offerkit/offerkit
  • SDK package: https://www.npmjs.com/package/@offerkit/sdk
  • License: MIT

FAQs

Package last updated on 18 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts