"use strict";

import { NativeModules, Platform } from 'react-native';
import { ok, err } from '@synonymdev/result';
const LINKING_ERROR = `The package 'react-native-pubky' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
  ios: "- You have run 'pod install'\n",
  default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const Pubky = NativeModules.Pubky ? NativeModules.Pubky : new Proxy({}, {
  get() {
    throw new Error(LINKING_ERROR);
  }
});
export async function auth(url, secretKey) {
  const res = await Pubky.auth(url, secretKey);
  if (res[0] === 'error') {
    return err(res[1]);
  }
  return ok(res[1]);
}
//# sourceMappingURL=index.js.map