starti.app 2.0.136 → 2.0.138

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.
@@ -229,6 +229,9 @@ export declare class App extends EventTargetWithType<{
229
229
  * ```
230
230
  */
231
231
  requestAppTracking: () => Promise<void>;
232
+ getTokens: () => Promise<string>;
233
+ showNotice: () => Promise<string>;
234
+ getString: (someString: string) => Promise<string>;
232
235
  private onStartiappReady;
233
236
  /**
234
237
  * @event navigatingPage
@@ -0,0 +1,10 @@
1
+ import { Startiapp } from "../../startiapp";
2
+ import { NoticeResponse, TokensResponse } from "./typings";
3
+ export declare class ExternalPurchaseCustomLink extends EventTarget {
4
+ private readonly startiapp;
5
+ private externalPurchaseCustomLinkIntegration;
6
+ constructor(startiapp: Startiapp);
7
+ getTokens(): Promise<TokensResponse>;
8
+ showNotice(): Promise<NoticeResponse>;
9
+ private handleUserTokensReceived;
10
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Represents information about a token received from StoreKit
3
+ */
4
+ export type TokenInfo = {
5
+ /** The raw Base64URL-encoded token string */
6
+ rawToken?: string;
7
+ /** Indicates whether the token was successfully decoded */
8
+ decoded?: boolean;
9
+ /** Error message if token retrieval failed */
10
+ error?: string;
11
+ /** Any additional decoded data from the token */
12
+ additionalData?: Record<string, unknown>;
13
+ };
14
+ /**
15
+ * Response from GetTokensAsync containing acquisition and services tokens
16
+ */
17
+ export type TokensResponse = {
18
+ /** Whether the app is eligible for external purchase custom links */
19
+ isEligible: boolean;
20
+ /** Dictionary of tokens by type (e.g., "ACQUISITION", "SERVICES") */
21
+ tokens?: Record<string, TokenInfo>;
22
+ /** Error code if the request failed */
23
+ error?: string;
24
+ /** Human-readable error message */
25
+ message?: string;
26
+ /** Raw response string if deserialization failed */
27
+ raw?: string;
28
+ };
29
+ /**
30
+ * Response from ShowNoticeAsync after displaying the external purchase disclosure
31
+ */
32
+ export type NoticeResponse = {
33
+ /** Whether the app is eligible for external purchase custom links */
34
+ isEligible: boolean;
35
+ /** Dictionary of tokens by type (e.g., "ACQUISITION", "SERVICES") */
36
+ tokens?: Record<string, TokenInfo>;
37
+ /** Status of the user's interaction: "continued", "cancelled", or "unknown" */
38
+ status?: string;
39
+ /** Error code if the request failed */
40
+ error?: string;
41
+ /** Human-readable error message */
42
+ message?: string;
43
+ /** Raw response string if deserialization failed */
44
+ raw?: string;
45
+ };
@@ -8,6 +8,7 @@ export declare class User extends EventTarget {
8
8
  deleteUser(options?: RequestUserDeletionOptions): Promise<void>;
9
9
  registerId(userId: string): Promise<void>;
10
10
  unregisterId(): Promise<void>;
11
+ private callExternalPurchaseCustomLinkIfExists;
11
12
  }
12
13
  interface RequestUserDeletionOptions {
13
14
  prompt?: string;
@@ -1,5 +1,6 @@
1
1
  import { NavigationSpinnerOptions, PermissionStatus, RegexDto, VibrationIntensity } from "./integrations/App/typings";
2
2
  import { BiometricsAuthenticationType, BiometricsResultReponse, SaveUsernameAndPasswordConfiguration } from "./integrations/Biometrics/BiometricsIntegration";
3
+ import { NoticeResponse, TokensResponse } from "./integrations/ExternalPurchaseCustomLink/typings";
3
4
  import { InApPurchasePurchaseType, InAppPurchaseGetProductResponse, InAppPurchaseProductResponse, InAppPurchaseResponse } from "./integrations/InAppPurchase/InAppPurchaseIntegration";
4
5
  import { GeofenceRegion, Location, LocationListeningOptions, LocationOptions } from "./integrations/Location/types";
5
6
  import { ListenResponse, NetworkAccess } from "./integrations/Network/NetworkIntegration";
@@ -65,6 +66,9 @@ type AppIntegration = {
65
66
  brandId(): string;
66
67
  deviceId(): string;
67
68
  version(): string;
69
+ getTokens(): string;
70
+ showNotice(): string;
71
+ getString(someString: string): string;
68
72
  addExcludedFromHistoryPattern(pattern: RegexDto): void;
69
73
  removeExcludedFromHistoryPattern(pattern: RegexDto): void;
70
74
  addExcludedFromHistoryDomain(domain: string): void;
@@ -135,6 +139,10 @@ type MediaIntegration = {
135
139
  increaseVolume(): void;
136
140
  decreaseVolume(): void;
137
141
  };
142
+ type ExternalPurchaseCustomLinkIntegration = {
143
+ getTokens(): TokensResponse;
144
+ showNotice(): NoticeResponse;
145
+ };
138
146
  export type Integrations = {
139
147
  AppIntegration: AppIntegration;
140
148
  DeviceIntegration: DeviceIntegration;
@@ -151,5 +159,6 @@ export type Integrations = {
151
159
  StorageIntegration: StorageIntegration;
152
160
  LocationIntegration: LocationIntegration;
153
161
  MediaIntegration: MediaIntegration;
162
+ ExternalPurchaseCustomLinkIntegration: ExternalPurchaseCustomLinkIntegration;
154
163
  };
155
164
  export {};
@@ -1,6 +1,7 @@
1
1
  import { App } from "./integrations/App/AppIntegration";
2
2
  import { Biometrics } from "./integrations/Biometrics/BiometricsIntegration";
3
3
  import { Developer } from "./integrations/Developer/DeveloperIntegration";
4
+ import { ExternalPurchaseCustomLink } from "./integrations/ExternalPurchaseCustomLink/ExternalPurchaseCustomLinkIntegration";
4
5
  import { InAppPurchase } from "./integrations/InAppPurchase/InAppPurchaseIntegration";
5
6
  import { Location } from "./integrations/Location/LocationIntegration";
6
7
  import { Media } from "./integrations/Media/MediaIntegration";
@@ -37,6 +38,7 @@ export declare class StartiappClass extends EventTarget {
37
38
  Trigger: Trigger;
38
39
  User: User;
39
40
  Media: Media;
41
+ ExternalPurchaseCustomLink: ExternalPurchaseCustomLink;
40
42
  set demoToken(value: string | null);
41
43
  get demoToken(): string | null;
42
44
  private _demoToken;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "starti.app",
3
3
  "author": "starti.app",
4
4
  "license": "MIT",
5
- "version": "2.0.136",
5
+ "version": "2.0.138",
6
6
  "description": "Use this package for easy communication with the starti.app API.",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",