react-native-gigya-sdk
Version:
SAP CDC/Gigya SDK for your React Native applications
26 lines • 766 B
JavaScript
import { NativeModules } from 'react-native';
const {
GigyaSdk
} = NativeModules;
import getState from './getState';
import { setState } from '../internals/state';
export default function (config) {
return new Promise(async (resolve, reject) => {
try {
await setState(config);
const updatedState = await getState();
const updatedConfig = {
lang: updatedState.lang,
apiKey: updatedState.apiKey,
storage: updatedState.storage,
dataCenter: updatedState.dataCenter,
storageKey: updatedState.storageKey,
linkAccountVersion: updatedState.linkAccountVersion
};
resolve(GigyaSdk.initialize(updatedConfig));
} catch (e) {
reject(e);
}
});
}
//# sourceMappingURL=init.js.map