feat: @orangecheck/me-client v0.1.0 — drop-in client for me.ochk.io#3
Merged
Conversation
The integrator-side SDK for me.ochk.io. Mirrors the public surface
documented at /integrate so the on-page code samples become real
imports:
import { OcSignInButton, oc, onTelemetry } from '@orangecheck/me-client';
Exports:
- <OcSignInButton scope={...} sessionPolicy={...} onSignin={...}/>
React component. Triggers the me.ochk.io consent flow, returns the
resulting Session via onSignin. Class C billable atom — once per
real session, signin within an open session is FREE.
- oc.session.{create, refresh, invalidate}
Session lifecycle hooks. create() is the billable atom; refresh
and invalidate are non-billable telemetry-only. Site declares the
SessionPolicy at integration time (banking 15-60min, SaaS 7-30d,
mobile 90d are the canonical shapes).
- oc.payment.authorize({ amount_sats|usd_cents, description, ... })
Class B billable event. Sub-Stripe rates; ~65% of the OC fee
flows to the user as Lightning cashback on /me/earn.
- onTelemetry(listener) -> unsubscribe
Subscribe to the developer telemetry stream — non-billable events
like session.token_refresh, auth.signin_cancelled,
verify.passive_check. Site has full observability of what users
are doing without paying for it.
- Canonical types: BillableEvent, EventClass ('A'|'B'|'C'),
EventSubtype, SessionPolicy, PaymentResult, TelemetryEvent.
Mirrors oc-me-web/src/lib/events/types.ts; same source of truth
for the three-class taxonomy from Addendum 01.
- setOrigin(url): swap the me.ochk.io origin for staging or
self-hosted me-equivalents. Default origin is https://me.ochk.io.
Stack: tsup → CJS + ESM + DTS, peer deps on react/react-dom and
@orangecheck/auth-client. Mirrors the auth-client package layout.
3 tests pass, type-check clean, build green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Xaxis
added a commit
that referenced
this pull request
Apr 30, 2026
The Packages workflow's build matrix was missing me-client, so PR #3 (me-client v0.1.0) merged green without ever building or testing the new package — and never auto-published to npm. v0.1.0 was published manually via NPM_TOKEN to unblock /integrate code samples. This commit closes that gap so future me-client versions go through the same gate every other package does: - packages.yml: add me-client to the build matrix. - release.yml: add me-client-v* to the tag-trigger list, plus a matching docstring entry. After merge, future releases ship with: yarn version → git tag me-client-v0.X.0 → git push --tags. Packages CI runs build+test on every push, release.yml publishes on tag push. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Xaxis
added a commit
that referenced
this pull request
Apr 30, 2026
…Fees (#5) * ci: add me-client to packages build matrix + release tag list The Packages workflow's build matrix was missing me-client, so PR #3 (me-client v0.1.0) merged green without ever building or testing the new package — and never auto-published to npm. v0.1.0 was published manually via NPM_TOKEN to unblock /integrate code samples. This commit closes that gap so future me-client versions go through the same gate every other package does: - packages.yml: add me-client to the build matrix. - release.yml: add me-client-v* to the tag-trigger list, plus a matching docstring entry. After merge, future releases ship with: yarn version → git tag me-client-v0.X.0 → git push --tags. Packages CI runs build+test on every push, release.yml publishes on tag push. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: @orangecheck/me-client v0.2.0 — IntegratorPriceConfig + computeFees Mirror the systemic refactor in oc-me-web. The package now exports the canonical integrator-configurable pricing types: - IntegratorPriceConfig — what every integrator declares - IntegratorEventConfig — per-subtype { enabled, site_pays, user_share_pct } - SiteFeeShape — { kind: 'fixed_sats' | 'percent_of_amount', ... } - ComputedFees — the four-way split: gross / platform / user / site_rebate Plus the platform constants OC inherits to all integrators: - PLATFORM_FEE_POLICY = { pct: 0.2, min_floor_sats: 1, ratified } - MIN_INTEGRATOR_PRICE_SATS = 5 - computeFees(cfg, payment_amount?) helper for client-side preview Type bundle grew 3.79 KB → 4.81 KB. Already published manually; this commit makes the version bump auditable in git history. Future versions auto-publish on me-client-v0.X.0 tags now that PR #4 added me-client to the release workflow's tag list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The integrator-side SDK for me.ochk.io. Mirrors the public surface documented at /integrate so the on-page code samples become real imports.
Exports
<OcSignInButton>React component — triggers the me.ochk.io consent flow, returns the resultingSessionviaonSignin. Class C billable atom; signin within an open session is FREE.oc.session.{create, refresh, invalidate}— session lifecycle hooks.createis billable;refreshandinvalidateare non-billable telemetry-only.oc.payment.authorize(...)— Class B billable event. Sub-Stripe rates; ~65% of the OC fee flows to the user as Lightning cashback.onTelemetry(listener)— subscribe to non-billable events (intra-session signins, refreshes, failed/cancelled, navigation, passive verifies).BillableEvent,EventClass,EventSubtype,SessionPolicy,PaymentResult,TelemetryEvent— mirrorsoc-me-web/src/lib/events/types.ts.setOrigin(url)— swap the origin for staging or self-hosted me-equivalents.Stack
tsup→ CJS + ESM + DTS. Peer deps:react,react-dom,@orangecheck/auth-client. Mirrors the auth-client package layout exactly.Test plan
yarn type-check— cleanyarn test— 3 tests passyarn build— CJS (5.22 KB) + ESM (4.55 KB) + DTS (3.79 KB) all emitted/integratedocumentsoc-packagesPackages workflow once merged🤖 Generated with Claude Code