Socket
Book a DemoInstallSign in
Socket

@aidc/account-rn

Package Overview
Dependencies
Maintainers
3
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aidc/account-rn

必须使用 `expo install` 安装 SDK 以及一些 `peerDependencies` 三方依赖。

1.0.70
latest
npmnpm
Version published
Weekly downloads
248
726.67%
Maintainers
3
Weekly downloads
 
Created
Source

账户中心 React Native SDK

安装依赖

必须使用 expo install 安装 SDK 以及一些 peerDependencies 三方依赖。

# 安装 SDK
$ npx expo install @aidc/account-rn

# 安装 peerDependencies
$ npx expo install @react-native-async-storage/async-storage@~2.1.0 @react-native-firebase/analytics@~22.0.0 @react-native-firebase/app@~22.0.0 @react-native-firebase/auth@~22.0.0 @react-native-google-signin/google-signin@~13.2.0 expo-apple-authentication@~7.1.0 expo-build-properties@~0.13.0 react-native-adjust@~5.1.0

修改配置

app.json 里添加插件。

{
  "expo": {
    "plugins": ["@aidc/account-rn"]
  }
}

然后重新预构建一下,再启动应用。

$ npx expo prebuild --clean
$ npx expo run:ios # 或 npx expo run:android

初始化

import { setAccountConfig } from '@aidc/account-rn';

setAccountConfig({
  env: 'prod', // 指定环境
  appId: 'your-app-id', // 由账户中心生成
  appVersion: 'your-app-version', // 当前 App 版本号
  adjustAppToken: 'your-adjust-app-token', // 可选,用于开启 Adjust 广告追踪
});

账户 API

判断邮箱是否注册

import { isEmailExist } from '@aidc/account-rn';

const isEmailExist = await isEmailExist(email);

邮箱密码注册

import { registerWithEmailAndPassword } from '@aidc/account-rn';

const { user, isAppNewUser } = await registerWithEmailAndPassword(
  email,
  password,
);

邮箱密码登录

import { loginWithEmailAndPassword } from '@aidc/account-rn';

const { user, isAppNewUser } = await loginWithEmailAndPassword(email, password);

Google 授权登录

import { loginWithGoogle, loginWithApple } from '@aidc/account-rn';

const { user, isAppNewUser } = await loginWithGoogle();

Apple 授权登录

import { loginWithApple } from '@aidc/account-rn';

const { user, isAppNewUser } = await loginWithApple();

获取当前用户

import { getCurrentUser } from '@aidc/account-rn';

const user = await getCurrentUser();

获取当前用户的 session token

import { getCurrentSessionToken } from '@aidc/account-rn';

const sessionToken = await getCurrentSessionToken();

退出当前用户

import { logoutCurrentUser } from '@aidc/account-rn';

await logoutCurrentUser();

注销当前用户

import { deleteCurrentUser } from '@aidc/account-rn';

await deleteCurrentUser();

埋点 API

记录页面 PV

import { logPV } from '@aidc/account-rn';

// 记录商品详情页 PV
logPV('product_detail', {
  product_id: '123',
  product_name: 'product_name',
});

记录事件

import { logEvent } from '@aidc/account-rn';

// 记录点击商品事件
logEvent('press', 'product_item', {
  product_id: '123',
  product_name: 'product_name',
});

广告 API

记录事件

import { logAdjustEvent } from '@aidc/account-rn';

await logAdjustEvent('adjust-event-token');

更新 SKAN 转化值

import { updateAdjustConversionValue } from '@aidc/account-rn';

await updateAdjustConversionValue(1);

FAQs

Package last updated on 28 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.