Skip to main content

polar-member-model

Migrate a Polar seat-based integration from customer_id to the member model. Use when Polar has told you your organization moves to the member model, or when code reads customer_id to identify who holds a seat.

소스 정보

저장소
polarsource/polar
최근 소스 활동
2026년 9월 28일 09:33
감지된 SKILL.md 언어
영어
스타
10,324
포크
798

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
polar-member-model
description
Migrate a Polar seat-based integration from customer_id to the member model. Use when Polar has told you your organization moves to the member model, or when code reads customer_id to identify who holds a seat.
# Migrate a Polar seat-based integration to the member model On seat-based products, `customer_id` used to be the seat holder. It becomes the buyer. Every seat and grant carries a `member`, which is the person. Read that. ## Change Find reads of `customer_id` on seats and benefit grants — REST responses and the `customer_seat.*`, `benefit_grant.*` webhooks — and rewrite the ones that mean "the person holding this seat": ```diff - grantAccess(seat.customer_id) + grantAccess(seat.member.id, seat.member.email) ``` Leave the ones that mean "the account that pays". `seat.email` and `seat.customer_email` already resolve to the holder; leave those too. ## Watch out A branch on whether `member` is set cannot tell a seat holder from a buyer: direct purchases carry the buyer's own member. ```diff - if (grant.member) { holder(grant.member) } else { buyer(grant.customer_id) } + holder(grant.member) ``` Keep a null check for the type, but read no meaning into it — Polar leaves `member` unset on old revoked grants. Use `member.role` to tell a buyer (`owner`, `billing_manager`) from a holder (`member`), and `member.customer_id` for the billing customer. ## Also - Seat-holder `customer_id` stored in your database will return `404`. Remap it to `member.id` from `GET /v1/customer-seats`, or set `external_member_id` at assignment and key on your own identifier. - Pass `member_id` to `customerSessions.create`. Required for team customers. - Never mix `customer_id`/`external_customer_id` with `member_id`/`external_member_id` in one seat assignment. ## Report List every read you left alone as "the buyer", so a human can check the call.
GitHub에서 보기