Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
39ca619
feat: add adapty_ui_destroy_flow_view to the cross-platform schema
StanislavMayorov Sep 16, 2026
3f20358
chore: bump version to 4.1.3
StanislavMayorov Sep 18, 2026
f3fb6f3
Merge pull request #38 from adaptyteam/feat/ui-destroy-flow-view
StanislavMayorov Sep 18, 2026
b23b7c1
chore: update yaml from https://github.com/adaptyteam/AdaptySDK-iOS/c…
StanislavMayorov Sep 21, 2026
c8a11a8
fix(codegen): render `type: string` + `anyOf` as an open enum union
StanislavMayorov Sep 21, 2026
d0ee010
feat: add PreloadPlacementsParamsInput
StanislavMayorov Sep 21, 2026
1133336
feat: drop onboarding preload from the schema
StanislavMayorov Sep 22, 2026
71df116
Merge pull request #39 from adaptyteam/release/4.2.0
StanislavMayorov Sep 22, 2026
c2d9981
feat: map the 4.2.0 schema additions onto the shared models
StanislavMayorov Sep 23, 2026
396204e
Merge pull request #40 from adaptyteam/release/4.2.0
StanislavMayorov Sep 23, 2026
8e324a2
feat: make storeMessagesHandling a cross-platform activation param
StanislavMayorov Sep 23, 2026
a418038
feat: add the Array<AdaptyStoreMessageType> result type
StanislavMayorov Sep 23, 2026
410c4ad
feat: add error codes 3201 and 3202
StanislavMayorov Sep 23, 2026
6df7646
Merge pull request #41 from adaptyteam/release/4.2.0
StanislavMayorov Sep 25, 2026
13e366e
docs: clarify the list of SDKs using the package
StanislavMayorov Sep 25, 2026
c5fb697
Merge pull request #42 from adaptyteam/release/4.2.0-cherry-pick
StanislavMayorov Sep 30, 2026
87d90d2
feat: add the debug log level and order LogLevel by verbosity
StanislavMayorov Sep 28, 2026
d1ecd75
chore: bump version to 4.3.0
StanislavMayorov Oct 13, 2026
83910fe
Merge pull request #44 from adaptyteam/release/4.3.0
StanislavMayorov Oct 13, 2026
5f3804f
chore: update yaml from https://github.com/adaptyteam/AdaptySDK-iOS/c…
StanislavMayorov Oct 13, 2026
14d54d4
feat: support subscription pricing terms, commitment info and purchas…
StanislavMayorov Oct 13, 2026
dc8af8f
feat: make SubscriptionBillingPlan an open string union
StanislavMayorov Oct 13, 2026
442b8da
test: cover pricing terms coders and platform-specific decoding; mark…
StanislavMayorov Oct 13, 2026
b4aa188
feat: decode android offer_id in AdaptySubscription
StanislavMayorov Oct 14, 2026
5f31d52
docs: describe profile billing plan fields as App Store-only, not iOS…
StanislavMayorov Oct 15, 2026
0bf7dcd
chore: update yaml from https://github.com/adaptyteam/AdaptySDK-iOS/c…
StanislavMayorov Oct 15, 2026
e5d13f0
feat: expose profile offerId at top level, deprecate AccessLevel andr…
StanislavMayorov Oct 15, 2026
9a75c60
refactor: require a platform adapter in Coder and pass it to nested c…
StanislavMayorov Oct 15, 2026
3b2b0c6
Merge pull request #45 from adaptyteam/release/4.3.0
StanislavMayorov Oct 19, 2026
4bb2d64
chore: update yaml from https://github.com/adaptyteam/AdaptySDK-iOS/c…
StanislavMayorov Oct 26, 2026
3289b5f
Merge pull request #46 from adaptyteam/chore/update-yaml
StanislavMayorov Oct 26, 2026
cf9a641
chore: update yaml from https://github.com/adaptyteam/AdaptySDK-iOS/c…
StanislavMayorov Oct 29, 2026
66528b3
feat: add ReportTransactionParamsCoder
StanislavMayorov Oct 29, 2026
0726ac7
Merge pull request #47 from adaptyteam/feat/report-transaction-params
StanislavMayorov Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ This repo uses platform dependency injection to keep `@adapty/core` platform-agn
- `ILoggerAdapter` for logging
- **Instantiation rule:** do not instantiate `*Coder` via `new` outside `src/coders/**`. In SDK / bridge / feature code, use `CoderFactory` as the single entry point.
- **When adding a new coder:** add a corresponding `create*Coder()` method to `CoderFactory` and use it instead of direct construction.
- **Platform propagation:** `Coder` requires an `IPlatformAdapter` in its constructor. A coder that nests another coder (in `properties`, fields, methods, `ArrayCoder`/`HashmapCoder`) must pass `this.platform`; otherwise platform-gated `required` checks inside `ios`/`android` blocks of the nested coder never fire.

### Testing Guidance

- Tests should create coders with mock adapters, not mutate `Platform` globals.
- Prefer inline adapters: `{ OS: 'ios' }` / `{ OS: 'android' }`.
- Coder tests that do not care about the platform pass `new DefaultPlatformAdapter()` (OS `'unknown'`, platform-gated checks off). `src/coders/nested-platform.test.ts` verifies that every coder reachable from `CoderFactory` shares the factory's adapter.

### Usage in Downstream SDKs

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
>
> This package is an internal dependency of Adapty JavaScript SDKs. It is not intended for direct installation.

This package contains the shared TypeScript foundation used by Adapty JavaScript SDKs, like React Native and Capacitor.
This package contains the shared TypeScript foundation used by Adapty JavaScript SDKs: React Native and Capacitor.

## Documentation

Expand Down
199 changes: 190 additions & 9 deletions cross_platform.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://adapty.io/crossPlatform/4.2.0/schema"
$id: "https://adapty.io/crossPlatform/4.3.2/schema"
title: "Cross Platform Format"

$requests:
Expand Down Expand Up @@ -117,6 +117,24 @@ $requests:
properties:
success: { const: true }

### destroyFlowView ###
AdaptyUIDestroyFlowView.Request: #request
type: object
required: [method, id]
properties:
method: { const: "adapty_ui_destroy_flow_view" }
id: { type: string, description: "View Id" }

AdaptyUIDestroyFlowView.Response: #response
type: object
oneOf:
- required: [error]
properties:
error: { $ref: "#/$defs/AdaptyError" }
- required: [success]
properties:
success: { const: true }

### presentOnboardingView ###
AdaptyUIPresentOnboardingView.Request: #request
type: object
Expand Down Expand Up @@ -291,6 +309,47 @@ $requests:
properties:
success: { $ref: "#/$defs/AdaptyFlow" }

### preloadFlows ###
PreloadFlows.Request: #request
type: object
required: [method, placement_ids]
properties:
method: { const: "preload_flows" }
placement_ids:
type: array
items: { type: string }
load_timeout: { type: number, description: "seconds" }

PreloadFlows.Response: #response
type: object
oneOf:
- required: [error]
properties:
error: { $ref: "#/$defs/AdaptyError" }
- required: [success]
properties:
success: { const: true }

### preloadFlowsForDefaultAudience ###
PreloadFlowsForDefaultAudience.Request: #request
type: object
required: [method, placement_ids]
properties:
method: { const: "preload_flows_for_default_audience" }
placement_ids:
type: array
items: { type: string }

PreloadFlowsForDefaultAudience.Response: #response
type: object
oneOf:
- required: [error]
properties:
error: { $ref: "#/$defs/AdaptyError" }
- required: [success]
properties:
success: { const: true }

### getPaywallProducts ###
GetPaywallProducts.Request: #request
type: object
Expand All @@ -308,10 +367,10 @@ $requests:
- required: [success]
properties:
success:
{
type: array,
items: { $ref: "#/$defs/AdaptyPaywallProduct.Response" },
}
type: array
items: { $ref: "#/$defs/AdaptyPaywallProduct.Response" }



### getProfile ###
GetProfile.Request: #request
Expand Down Expand Up @@ -465,6 +524,46 @@ $requests:
properties:
success: { $ref: "#/$defs/AdaptyPurchaseResult" }

### getPendingStoreMessageTypes ###
GetPendingStoreMessageTypes.Request: #request
type: object
description: "iOS Only. Requires iOS 16+"
required: [method]
properties:
method: { const: "get_pending_store_message_types" }

GetPendingStoreMessageTypes.Response: #response
type: object
oneOf:
- required: [error]
properties:
error: { $ref: "#/$defs/AdaptyError" }
- required: [success]
properties:
success:
type: array
items: { $ref: "#/$defs/AdaptyStoreMessageType" }

### showStoreMessage ###
ShowStoreMessage.Request: #request
type: object
description: "Requires iOS 16+ on iOS"
required: [method]
properties:
method: { const: "show_store_messages" }
filter:
type: array
items: { $ref: "#/$defs/AdaptyStoreMessageType" }

ShowStoreMessage.Response: #response
type: object
oneOf:
- required: [error]
properties:
error: { $ref: "#/$defs/AdaptyError" }
- required: [success]
properties:
success: { const: true }
OpenWebPaywall.Request: #request
type: object
required: [method]
Expand Down Expand Up @@ -547,6 +646,7 @@ $requests:
method: { const: "report_transaction" }
variation_id: { type: string }
transaction_id: { type: string }
apple_jws_transaction: { type: string }

ReportTransaction.Response: #response
type: object
Expand Down Expand Up @@ -1162,6 +1262,11 @@ $defs:
customer_identity_parameters:
{ $ref: "#/$defs/CustomerIdentityParameters" }
observer_mode: { type: boolean, default: false }
store_messages_handling:
{
$ref: "#/$defs/StoreMessagesHandling",
description: "Requires iOS 16+ on iOS",
}
apple_idfa_collection_disabled: { type: boolean, default: false }
google_adid_collection_disabled: { type: boolean, default: false }
google_enable_pending_prepaid_plans: { type: boolean, default: false }
Expand All @@ -1184,6 +1289,20 @@ $defs:
memory_storage_count_limit: { type: integer }
disk_storage_size_limit: { type: integer, description: "bytes" }

StoreMessagesHandling: #request
type: string
enum: ["auto", "manual", "default"]

AdaptyStoreMessageType: #request #response
type: string
anyOf:
- enum:
- generic
- price_increase_consent
- billing_issue
- win_back_offer
- pattern: "^storekit_-?[0-9]+$"

CustomerIdentityParameters: #request
type: object
properties:
Expand Down Expand Up @@ -1228,7 +1347,10 @@ $defs:

AdaptyPrice: #response
type: object
required: [amount]
required:
- amount
- currency_code # iOS Only
- localized_string # iOS Only
properties:
amount: { type: number }
currency_code: { type: string }
Expand All @@ -1238,12 +1360,19 @@ $defs:
AdaptyPromotedProduct.Request: #request
type: object
required:
- purchase_intent_id # iOS Only
- vendor_product_id
properties:
purchase_intent_id: { type: string } # iOS Only
vendor_product_id: { type: string }
subscription:
type: object
properties:
pricing_terms: # iOS Only
type: object
required: [billing_plan_id]
properties:
billing_plan_id: { type: string }
offer:
type: object
required: [offer_identifier]
Expand All @@ -1255,12 +1384,14 @@ $defs:
AdaptyPromotedProduct.Response: #event
type: object
required:
- purchase_intent_id # iOS Only
- vendor_product_id
- localized_description
- localized_title
- is_family_shareable # iOS Only
- price
properties:
purchase_intent_id: { type: string } # iOS Only
vendor_product_id: { type: string }
localized_description: { type: string }
localized_title: { type: string }
Expand All @@ -1271,17 +1402,41 @@ $defs:
subscription: { $ref: "#/$defs/AdaptyProduct.Subscription" }
payload_data: { type: string }

AdaptySubscriptionPricingTerms: #event #response
type: object
required:
- billing_plan_id
- billing_price
- billing_period
- commitment_info
properties:
billing_plan_id: { type: string }
billing_price: { $ref: "#/$defs/AdaptyPrice" }
billing_period: { $ref: "#/$defs/AdaptySubscriptionPeriod" }
commitment_info: { $ref: "#/$defs/AdaptySubscriptionCommitmentInfo" }

AdaptySubscriptionCommitmentInfo: #event #response
type: object
required:
- price
- period
properties:
price: { $ref: "#/$defs/AdaptyPrice" }
period: { $ref: "#/$defs/AdaptySubscriptionPeriod" }

AdaptyProduct.Subscription: #event #response
type: object
required:
- group_identifier # iOS Only
- period
- pricing_terms # iOS Only
- renewal_type # Android Only
- base_plan_id # Android Only
properties:
group_identifier: { type: string, description: "iOS Only" }
period: { $ref: "#/$defs/AdaptySubscriptionPeriod" }
localized_period: { type: string }
pricing_terms: { $ref: "#/$defs/AdaptySubscriptionPricingTerms" }
offer: { $ref: "#/$defs/AdaptySubscriptionOffer" }
renewal_type: # Android Only
type: string
Expand Down Expand Up @@ -1312,6 +1467,11 @@ $defs:
subscription:
type: object
properties:
pricing_terms: # iOS Only
type: object
required: [billing_plan_id]
properties:
billing_plan_id: { type: string }
offer:
type: object
required: [offer_identifier]
Expand Down Expand Up @@ -1519,10 +1679,18 @@ $defs:
adapty_product_id: { type: string }
access_level_id: { type: string }
product_type: { type: string }
promotional_offer_id: { type: string, description: "iOS Only" }
win_back_offer_id: { type: string, description: "iOS Only" }
base_plan_id: { type: string, description: "Android Only" }
offer_id: { type: string, description: "Android Only" }
pricing_terms: # iOS only
type: array
items:
type: object
required:
- billing_plan_id # iOS only
properties:
billing_plan_id: { type: string } # iOS only
promotional_offer_id: { type: string } # iOS only
win_back_offer_id: { type: string } # iOS only

AdaptySubscriptionPeriod: #response
type: object
Expand Down Expand Up @@ -1600,6 +1768,8 @@ $defs:
billing_issue_detected_at: { $ref: "#/$defs/Date" }
starts_at: { $ref: "#/$defs/Date" }
cancellation_reason: { type: string }
billing_plan_id: { type: string, description: "iOS Only" }
commitment: { $ref: "#/$defs/AdaptyProfile.SubscriptionCommitmentInfo" }
is_refund: { type: boolean }

AdaptyProfile.NonSubscription: #response
Expand Down Expand Up @@ -1636,6 +1806,7 @@ $defs:
- is_refund
- is_sandbox
- will_renew
- billing_plan_id # iOS Only
properties:
store: { type: string }
vendor_product_id: { type: string }
Expand All @@ -1658,6 +1829,16 @@ $defs:
active_promotional_offer_id: { type: string }
offer_id: { type: string }
cancellation_reason: { type: string }
billing_plan_id: { type: string, description: "iOS Only" }
commitment: { $ref: "#/$defs/AdaptyProfile.SubscriptionCommitmentInfo" }

AdaptyProfile.SubscriptionCommitmentInfo: #response
type: object
required: [billing_period_number, total_billing_periods, expires_at]
properties:
billing_period_number: { type: integer, minimum: 0 }
total_billing_periods: { type: integer, minimum: 0 }
expires_at: { $ref: "#/$defs/Date" }

AdaptyProfile.CustomAttributes:
type: object
Expand Down Expand Up @@ -1694,7 +1875,7 @@ $defs:
analytics_disabled: { type: boolean }

AdaptySubscriptionOffer.Identifier: #request #response
type: string
type: object
oneOf:
- required: [type]
properties:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@adapty/core",
"version": "4.2.0",
"version": "4.3.2",
"description": "Platform-agnostic core for Adapty JS SDKs",
"license": "MIT",
"author": "Adapty team <support@adapty.io>",
Expand Down
Loading
Loading