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

@gyjshow/react-native-wechat

v1.2.8

Published

React Native WeChat plugin for WeChat Pay and Share (iOS & Android)

Readme

@gyjshow/react-native-wechat

A lightweight React Native plugin for integrating WeChat Pay & WeChat Share on iOS and Android.

Supports:

  • ✅ WeChat Pay
  • ✅ Share Text
  • ✅ Share Webpage
  • ✅ Share Image
  • ✅ Share to Friends & Moments
  • ✅ Get WeChat SDK Version
  • ✅ Event / Promise callback handling

Compatible with React Native >= 0.83


Features

  • 🔹 Unified API for iOS & Android
  • 🔹 Supports WeChat Pay
  • 🔹 Share text / webpage / image
  • 🔹 Share to friends (session) & Moments (timeline)
  • 🔹 Fetch WeChat SDK version
  • 🔹 Event-based & Promise-based callbacks
  • 🔹 Lightweight & easy to integrate

Installation

# npm
npm install @gyjshow/react-native-wechat

# pnpm
pnpm add @gyjshow/react-native-wechat

Platform Setup

iOS Setup

s.dependency 'WechatOpenSDK-XCFramework'
# CocoaPods 会拉取最新版本

👉 See detailed iOS configuration:
⚠️ **参考 `Code下 README_iOS.md` 配置**
cd ios && pod install

Android Setup

api 'com.tencent.mm.opensdk:wechat-sdk-android:+' 
# Maven Central 最新版本

👉 See detailed Android WXEntryActivity:
⚠️ **参考 `Code下 README_WXEntryActivity.md` 配置**
Sync Project

Usage

Import

import WeChat from '@gyjshow/react-native-wechat';

Register App (Required)

WeChat.registerApp('wx1234567890abcdef');

Call this once when your app starts.


WeChat Pay

const payParams = {
  appId: 'wx123456',
  partnerId: '1900000109',
  prepayId: 'wx201411101639507cbf6ffd8b0779950874',
  nonceStr: '1101000000140429eb40476f8896f4c9',
  timeStamp: '1398746574',
  package: 'Sign=WXPay',
  sign: 'C380BEC2BFD727A4B6845133519F3AD6'
};

const result = await WeChat.wxpay(payParams);

Share Text

await WeChat.shareText('Hello WeChat!', 'session');
await WeChat.shareText('Hello Moments!', 'timeline');

Share Webpage

await WeChat.shareWebpage(
  'https://your-website.com',
  'Website Title',
  'Website description',
  null,
  'session'
);

Share Image

await WeChat.shareImage(base64ImageString, 'timeline');

Get WeChat SDK Version

const version = await WeChat.getVersion();

Event & Callback Handling

Event Listener

const sub = WeChat.addListener(resp => {
  console.log(resp);
});

// remove
sub.remove();

One-time Promise

const resp = await WeChat.once();

Response Structure

interface WeChatResp {
  errCode: number; // 0 = success, -1 = error, -2 = cancel
  errStr: string;
  type: 'pay' | 'share' | 'auth';
}

API Reference

| Method | Description | |------|------------| | registerApp | Register WeChat App | | wxpay | WeChat Pay | | shareText | Share text | | shareWebpage | Share webpage | | shareImage | Share image | | getVersion | SDK version | | addListener | Add listener | | once | One-time callback |


Notes

  • You must register your app in WeChat Open Platform
  • WeChat Pay requires backend order generation
  • Thumbnail size must be ≤ 32KB
  • AppID must match iOS Bundle ID & Android Package Name

License

MIT