Skip to content

docs: scope markets, paper trading and OTC wording to account regions - #1305

Merged
hogan-yuan merged 1 commit into
mainfrom
docs/us-scope-neutral-wording
Oct 26, 2026
Merged

hogan-yuan merged 1 commit into
mainfrom
docs/us-scope-neutral-wording

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

The docs site is one build served to both AP (Longbridge HK / SG) and Longbridge US users, so this scopes region-specific claims instead of hiding them:

  • FAQ (qa/general, qa/trade, all locales): paper accounts are AP-only; market coverage states which products apply to AP vs Longbridge US accounts; removes the "short selling is supported for US stocks" and "OTC … not supported in paper accounts" sentences.
  • Homepage: replaces "4 markets · US · HK · SG · CN" and hard-coded market badges with region-neutral wording; warrants are described as available where the market offers them.
  • Paper-trading selling points (homepage, pricing FAQ) say paper trading is for Longbridge HK / SG accounts.

Pricing, Agent Platform, short-selling pages, crypto account wording and legal/footer links are left for separate decisions.

🤖 Generated with Claude Code

@hogan-yuan
hogan-yuan merged commit d9c69b7 into main Oct 26, 2026
2 checks passed
@hogan-yuan
hogan-yuan deleted the docs/us-scope-neutral-wording branch October 26, 2026 06:32
twosugar added a commit that referenced this pull request Oct 26, 2026
…e quote store (#1306)

## Problem

- US users saw the navbar **Pricing**, the homepage **See pricing**
button and the paid plans on `/pricing` (LBUS does not sell these
OpenAPI quote packages).
- The paid plan prices were hard-coded in `HK$` and no longer matched
the store (HK LV2 OpenAPI monthly 718 on the page vs 498 in the store;
OPRA monthly 40 vs 28).

## Change

**1. Hide pricing for US users** (`feat(pricing): hide pricing
entries…`)

New `isUSUser()` in `@longbridge/openapi-utils`
(`packages/utils/src/us-user.ts`), decided in order:
1. Logged in → `app_id` cookie is a US tenant (`longbridge_us` /
`longbridge_us_uat`)
2. Not logged in → `region` cookie is `US` (case-insensitive)
3. No `region` cookie → `x-ip-region` header from the portal `GET
/api/_ping` (same endpoint h5hub / longbridge-websites use)

Cached per page; any failure counts as non-US. When true, hides the
navbar Pricing link (desktop + mobile), the homepage *See pricing*
button and the *Subscribe only to what you need* plans. Free tier,
comparison table and FAQ stay.

**2. Load plan prices from the quote store** (`feat(pricing): load paid
quote plan prices…`)

`GET /v2/rewards/quote_product_list?account_channel=lb` with `x-app-id:
longbridge` (no login needed; CORS allows the docs origins and
`x-app-id`), matched by `package_key` `HK_L2_International_OpenAPI` /
`US_OPRA_LV1_OpenAPI`:
- Currency from each SKU — no hard-coded symbol.
- Price = `real_price`; `per_month_price` shown for quarterly / annual;
when `price > real_price`, discount % and original price are shown.
- Billing-cycle tabs built from `card_duration` (1/2/3 =
month/quarter/year, 5 = auto-renew, same enum as h5hub opa) — only
cycles the API returns. Production currently returns 1/2/3 only, so
*Auto-renew* is not shown; it appears automatically once the store
returns it.
- Loading / failure → `—`.

## Verification (local dev against production portal data)

Local dev cannot call the portal directly (CORS), so it was tested
through a throwaway local proxy that forwards to `mr.lbkrs.com` and adds
CORS headers (not committed).

| Cycle | HK LV2 Advanced | OPRA US Options |
|---|---|---|
| Monthly | HKD 498 /mo | HKD 28 /mo |
| Quarterly | HKD 998 /quarter, ≈HKD 333/mo | HKD 58 /quarter, ≈HKD
19/mo |
| Annual | HKD 3698 /year −38%, ≈HKD 308/mo, was HKD 5976 | HKD 188
/year −44%, ≈HKD 16/mo, was HKD 336 |

- `/zh-CN/pricing` renders 月付 / 季付 / 年付 with the same data.
- `region=US` → Pricing link, See pricing and the paid plans are hidden;
`region=hk` → shown; no `region` → `/api/_ping` called, `x-ip-region:
HK` read, shown.
- Logged-in branch tested by stubbing the login bridge and calling
`isUSUser()` (US app_id → true even with `region=hk`; HK app_id → false
even with `region=US`).
- In a real browser on `open.longbridge.com` and
`open-canary.longbridge.xyz`, `/api/_ping` returns 200 and `x-ip-region`
is readable.
- oxlint: clean on the changed files.

Not verified: a real US IP end-to-end, and a real logged-in US session
on this branch.

## Notes

- Canary portal data has no `US_OPRA_LV1_OpenAPI` and only annual for HK
LV2, so on canary the OPRA card shows `—` and fewer cycles.
- The US tenant `app_id` list now exists in three places
(`BaseLayout.astro` inline bootstrap, `packages/tryit`, and the new
file); the new file notes they must match.
- Rebased onto #1305 (pricing FAQ wording) without conflicts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant