accounts
Version:
Tempo Accounts SDK
24 lines • 894 B
JavaScript
import * as CoreProvider from '../core/Provider.js';
import * as Storage from '../core/Storage.js';
import { reactNative } from './adapter.js';
import { asyncStorage } from './storage.js';
/** Creates a provider for React Native apps using system browser authentication. */
export function create(options) {
const { host = 'https://wallet.tempo.xyz', redirectUri, open, secureStorage, ...rest } = options;
return CoreProvider.create({
storage: defaultStorage(),
...rest,
adapter: reactNative({
host,
redirectUri,
...(open ? { open } : {}),
...(secureStorage ? { secureStorage } : {}),
}),
});
}
function defaultStorage() {
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative')
return asyncStorage();
return Storage.memory();
}
//# sourceMappingURL=Provider.js.map