SDK Reference - start
React native
Flutter
Swift
Kotlin
The start method initializes IAPHUB and is a prerequisite for using other SDK methods.
It's important to note that if the start method is called again, all previous data will be reset. For instance, you'll need to authenticate the user again. Make sure to implement security measures to prevent unnecessary calls to the method.
Example
await Iaphub.start({
appId: "5e4890f6c61fc971cf46db4d",
apiKey: "SDp7aY220RtzZrsvRpp4BGFm6qZqNkrt",
enableStorekitV2: true,
lang: "en"
});
React Native
Flutter
Swift
Kotlin
Parameters
Object
StringID of your app (available on the settings page of the IAPHUB dashboard)
StringClient API key (available on the settings page of the IAPHUB dashboard)
StringUser id of then authenticated user
BooleanAllows purchase when the user is not logged in.
By default, this feature is disabled, causing the buy method to return an error when the user isn't logged in.
StringSpecifies the environment for the app, which must be created on the settings page of the IAPHUB dashboard.
BooleanEnables StoreKit V2 if available on iOS 15 and above (recommended if you've configured the App Store API).
lang
(Optional)StringISO language code of the user, used to load the localized product titles and descriptions from IAPHUB.
If not specified, IAPHUB will retrieve the localized titles and descriptions directly from Apple or Google (e.g., en, fr, pt-BR).
Response
This method does not return any response.