@payos-inc/payos-react 1.2.1-staging.101 → 1.2.1-staging.103
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.
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment utilities for PayOS Elements
|
|
3
3
|
*/
|
|
4
|
+
export type PayOSEnvironment = 'sandbox' | 'production';
|
|
5
|
+
/**
|
|
6
|
+
* Throw a configuration error unless `environment` is exactly 'sandbox' or 'production'.
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertValidEnvironment(environment: unknown): asserts environment is PayOSEnvironment;
|
|
4
9
|
/**
|
|
5
10
|
* Get the API base URL based on environment and optional development override.
|
|
6
11
|
*
|
|
7
12
|
* @param environment - 'sandbox' or 'production'
|
|
8
13
|
* @param developmentApiUrl - Optional override for local development (e.g., 'http://localhost:3000')
|
|
9
14
|
* @returns The API base URL to use for all SDK/API calls
|
|
15
|
+
* @throws Error if `environment` is not 'sandbox' or 'production'
|
|
10
16
|
*
|
|
11
17
|
* @example
|
|
12
18
|
* // Local development
|
|
@@ -18,4 +24,4 @@
|
|
|
18
24
|
* // Production live
|
|
19
25
|
* getApiBaseUrl('production') // => 'https://api.payos.ai'
|
|
20
26
|
*/
|
|
21
|
-
export declare function getApiBaseUrl(environment:
|
|
27
|
+
export declare function getApiBaseUrl(environment: PayOSEnvironment, developmentApiUrl?: string): string;
|
package/package.json
CHANGED