smithery/strataga

polar-sdk-cancel-subscription

Fix for Polar SDK subscription cancellation. Use when: (1) TypeScript error "Property 'cancel' does not exist on type 'Subscriptions'", (2) trying to cancel a Polar subscription via SDK, (3) build failure with polar.subscriptions.cancel(). The correct method is revoke() not cancel().

Installation

$ npx skills add smithery/strataga --skill polar-sdk-cancel-subscription

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/strataga.

npx skills add smithery/strataga

Browse all from smithery/strataga

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,948 B
  • docs SUMMARY.md 323 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Polar SDK Subscription Cancellation

Problem

When trying to cancel a subscription using the Polar SDK, you might try:

await polar.subscriptions.cancel({ id: subscriptionId });

This causes a TypeScript/build error:

Type error: Property 'cancel' does not exist on type 'Subscriptions'.

Context / Trigger Conditions

  • TypeScript error about cancel not existing on Subscriptions
  • Build failure in code that cancels Polar subscriptions
  • Following outdated examples or documentation

Solution

The correct method is revoke(), not cancel():

// WRONG
await polar.subscriptions.cancel({ id: subscriptionId });

// CORRECT
await polar.subscriptions.revoke({ id: subscriptionId });

Full Example

import { Polar } from "@polar-sh/sdk";

const polar = new Polar({
  accessToken: process.env.POLAR_ACCESS_TOKEN,
});

export async function cancelSubscription(subscriptionId: string) {
  const result = await polar.subscriptions.revoke({
    id: subscriptionId,
  });
  return result;
}

Verification

  • TypeScript compiles without errors
  • Subscription is canceled immediately in Polar
  • Returns the revoked subscription object

Notes

  • revoke() cancels the subscription immediately
  • For canceling at period end, use a different approach (update subscription)
  • The Polar SDK also has polar.customerPortal.subscriptions.cancel() for customer-initiated cancellation (different use case)

References