@namiml/web-sdk
Version:
Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing
40 lines (39 loc) • 1.76 kB
TypeScript
import { InitialConfig, InitialConfigCompressed } from "../config";
import { NamiLanguageCodes } from "./languages";
import { NamiLogLevel } from "./loglevel";
/**
* @type NamiInitialConfig
*
* Defines the structure of the initial configuration that can be provided
* when setting up the Nami SDK.
*/
export type NamiInitialConfig = InitialConfig | InitialConfigCompressed;
/**
* @type NamiConfiguration
* This is needed to configure and initialize the SDK via [Nami.configure]
* method
*
* @param appPlatformID A UUID for the app. You can find the Nami App Platform ID in the App
* Settings screen on the Platforms tab in the Nami Control Center.
* @param logLevel Optional preferable [NamiLogLevel] to set within SDK to get appropriate
* logging information. Make sure to either not set this param in release build, or set
* to [NamiLogLevel.ERROR] if you would like Nami error logs to be shown in your release/production
* app build. Default is set to [NamiLogLevel.WARN]
* @param namiCommands provides set of external commands useful for SDK.
* @param initialConfig contains initial configuration, useful in offline mode.
* @param namiLanguageCode sets the language to be used for paywalls on the device. Select from
* [NamiLanguageCode]
* <p>
* Default is set to `false`. Note that this should be set to `true` only from `debug` or
* `non-production` version of the app. Setting this to `true` in a `production` build can
* potentially have unwanted consequences.
*/
export type NamiConfiguration = {
appPlatformID: string;
logLevel?: NamiLogLevel;
namiCommands?: string[];
namiLanguageCode?: NamiLanguageCodes;
initialConfig?: string | NamiInitialConfig;
formFactor?: string;
purchaseChannel?: string;
};