@farm.js/polar 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -962,7 +962,10 @@ export function polar(input) {
962
962
  {
963
963
  name: meter.eventName,
964
964
  externalCustomerId: resolved.externalCustomerId,
965
- externalId: body.idempotencyKey,
965
+ // Polar dedupes externalId across the organization, so a
966
+ // caller's key is kept to its own customer: one customer can
967
+ // never claim, and so drop, another customer's usage event.
968
+ externalId: `${resolved.externalCustomerId}:${body.idempotencyKey}`,
966
969
  timestamp: occurredAt,
967
970
  metadata,
968
971
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm.js/polar",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "Polar billing integration for Farm.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@polar-sh/sdk": "^0.47.0",
33
- "@farm.js/core": "0.1.40",
34
- "@farm.js/integration-utils": "0.1.40"
33
+ "@farm.js/core": "0.1.42",
34
+ "@farm.js/integration-utils": "0.1.42"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc",