npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aidc/account-rn

v1.1.17

Published

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

Readme

账户中心 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);