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

expo-tiktok-business

v0.1.2

Published

A expo module for tiktok business sdk

Readme

expo-tiktok-business

An Expo module for the TikTok Business SDK that helps you track events and conversions in your Expo app. This module supports iOS, Android, and has stub implementation for web.

Features

  • 📱 Cross-platform support (iOS, Android, web)
  • 🔍 Debug mode for development
  • 🧩 Standard TikTok events defined as enums
  • 🔄 Automatic app lifecycle tracking
  • 🛣️ Expo Router integration for screen tracking
  • 🛠️ Helper methods for common events

Installation

In managed Expo projects

npx expo install expo-tiktok-business

In bare React Native projects

npm install expo-tiktok-business
npx expo prebuild --clean

Configure for iOS

npx pod-install

Usage

Initialize the SDK

Platform-specific initialization

TikTok often requires different App IDs for iOS and Android. You can provide platform-specific IDs:

// With platform-specific app IDs and TikTok App IDs
TiktokSDK.initialize(
  {
    ios: 'APPLE_APP_ID',      // iOS app ID
    android: 'com.yourcompany.yourapp',  // Android package name
    default: 'com.yourcompany.yourapp'   // Fallback for other platforms
  },
  {
    ios: 'YOUR_IOS_TIKTOK_APP_ID',       // TikTok App ID for iOS
    android: 'YOUR_ANDROID_TIKTOK_APP_ID', // TikTok App ID for Android
    default: 'YOUR_DEFAULT_TIKTOK_APP_ID'  // Fallback for other platforms
  },
  {
    debugMode: __DEV__
  }
);

Track Standard Events

// Track a product view
TiktokSDK.trackEvent(TiktokEventName.VIEW_CONTENT, {
  content_id: 'product-123',
  content_type: 'product',
  content_category: 'electronics',
});

// Track a search
TiktokSDK.trackSearch('wireless headphones', {
  category: 'electronics',
});

// Track a purchase
TiktokSDK.trackCompletePurchase(
  99.99, // value
  'USD', // currency
  [
    {
      content_id: 'product-123',
      content_type: 'product',
      content_name: 'Wireless Headphones',
      quantity: 1,
      price: 99.99,
    }
  ],
  {
    order_id: 'ORDER-12345',
  }
);

Expo Router Integration

import { useTiktokRouteTracking } from 'expo-tiktok-business';

// In your app's root component
export default function App() {
  // This will initialize tracking for Expo Router
  useTiktokRouteTracking();
  
  return (
    <RootLayoutNav />
  );
}

// Alternatively, use the HOC
import { withTiktokRouteTracking } from 'expo-tiktok-business';

const MyComponent = () => <View>...</View>;
export default withTiktokRouteTracking(MyComponent);

For manual integration with Expo Router:

import { usePathname, useSearchParams } from 'expo-router';
import { ExpoRouterIntegration } from 'expo-tiktok-business';

// In your app's root component
useEffect(() => {
  // Provide the Expo Router hooks directly
  ExpoRouterIntegration.setupWithRouter(usePathname, useSearchParams);
  
  return () => {
    ExpoRouterIntegration.cleanup();
  };
}, []);

Debug Mode

Enable debug mode during development to see events in the console:

// During initialization
TiktokSDK.initialize('YOUR_APP_ID', 'YOUR_TIKTOK_APP_ID', { debugMode: true });

// Or toggle it later
TiktokSDK.setDebugMode(true);

Available Standard Events

The module includes all standard TikTok events as enums:

  • TiktokEventName.LAUNCH - App launch
  • TiktokEventName.APP_INSTALL - App installation
  • TiktokEventName.SEARCH - User searched for content
  • TiktokEventName.VIEW_CONTENT - User viewed content
  • TiktokEventName.CLICK - User clicked on content
  • TiktokEventName.ADD_TO_WISHLIST - User added item to wishlist
  • TiktokEventName.ADD_TO_CART - User added item to cart
  • TiktokEventName.INITIATE_CHECKOUT - User started checkout
  • TiktokEventName.ADD_PAYMENT_INFO - User added payment info
  • TiktokEventName.COMPLETE_PAYMENT - User completed payment
  • TiktokEventName.PLACE_AN_ORDER - User placed an order
  • TiktokEventName.SUBSCRIBE - User subscribed
  • TiktokEventName.CONTACT - User initiated contact
  • TiktokEventName.CUSTOM - Custom event

Credits and Contributions

This module is based on the foundation work by Lior Levy from the original expo-tiktok-business project. We've extended it with:

  • Platform-specific app ID and TikTok app ID support
  • Enhanced event tracking with strongly-typed parameters
  • Automatic app lifecycle tracking
  • Expo Router integration
  • Debug mode support based on TikTok's documentation

Special thanks to the original authors for providing the initial implementation.

License

MIT


Generated with contributions from the community.