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.0.8

Published

待测试验证!!! React Native WeChat plugin for WeChat Pay and Share (iOS & Android)

Downloads

851

Readme

@gyjshow/react-native-wechat

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

Supports:

  • ✅ WeChat Pay
  • ✅ Share Text
  • ✅ Share Webpage
  • ✅ Share Image
  • ✅ Share to Friends & Moments
  • ✅ Get WeChat SDK Version

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
  • 🔹 Lightweight & easy to integrate

Installation

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

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

Platform Setup


iOS Setup

1️⃣ Add URL Scheme (WeChat AppID)

Open ios/YourProject/Info.plist and add:

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>wx1234567890abcdef</string>
    </array>
  </dict>
</array>

⚠️ Replace wx1234567890abcdef with your real WeChat AppID.


2️⃣ Install Pods

cd ios
pod install

Android Setup

No additional configuration required beyond normal React Native setup.

Make sure:

  • Your AppID is registered in WeChat Open Platform
  • You are using official SDK version 6.8.0
  • Your package name matches the one registered in WeChat

Usage


Import

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

Register App (Required)

You must register your AppID before using any feature.

WeChat.registerApp('wx1234567890abcdef');

Call this once when your app starts.


WeChat Pay

WeChat Pay requires server-side order generation.

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

try {
  const result = await WeChat.wxpay(payParams);
  console.log('Pay result:', result);
} catch (error) {
  console.error('Pay failed:', error);
}

Share Text

await WeChat.shareText('Hello WeChat!', 'session');   // Share to friend
await WeChat.shareText('Hello Moments!', 'timeline'); // Share to Moments

Share Webpage

await WeChat.shareWebpage(
  'https://your-website.com',
  'Website Title',
  'Website description',
  null,               // optional thumbnail (base64, ≤32KB)
  'session'
);

Share Image

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

Image must be Base64 format.


Get WeChat SDK Version

const version = await WeChat.getVersion();
console.log('WeChat SDK version:', version);

API Reference

| Method | Params | Returns | Description | |--------|--------|---------|------------| | registerApp(appId: string) | WeChat AppID | void | Register WeChat App | | pay(params) | WeChat pay params | Promise<string> | Initiate WeChat payment | | shareText(text, scene) | text, session / timeline | Promise<string> | Share text | | shareWebpage(url, title, desc, thumbBase64, scene) | webpage params | Promise<string> | Share webpage | | shareImage(base64, scene) | base64 image | Promise<string> | Share image | | getVersion() | - | Promise<string> | Get WeChat SDK version |


Example

import React, { useEffect } from 'react';
import { Button, View, Alert } from 'react-native';
import WeChat from '@gyjshow/react-native-wechat';

export default function App() {

  useEffect(() => {
    WeChat.registerApp('wx1234567890abcdef');
  }, []);

  const handlePay = async () => {
    try {
      const result = await WeChat.pay({
        appId: 'wx123456',
        partnerId: '1900000109',
        prepayId: 'prepay_id',
        nonceStr: 'nonce',
        timeStamp: '1234567890',
        package: 'Sign=WXPay',
        sign: 'xxxx'
      });

      Alert.alert('Pay Result', result);
    } catch (e: any) {
      Alert.alert('Pay Failed', e.message);
    }
  };

  return (
    <View>
      <Button title="Pay with WeChat" onPress={handlePay} />
    </View>
  );
}

Notes

  • You must register your app in WeChat Open Platform.
  • WeChat Pay requires backend order generation.
  • Thumbnail size must be ≤ 32KB (WeChat official requirement).
  • Ensure your AppID matches your bundle identifier (iOS) and package name (Android).
  • Test in sandbox before production.

License

MIT