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

@nstudio/nativescript-tiktok

v1.0.0

Published

TikTok Business SDK (App Events) for NativeScript

Downloads

50

Readme

@nstudio/nativescript-tiktok

TikTok Business SDK (App Events) for NativeScript.

Installation

npm install @nstudio/nativescript-tiktok

Prerequisites

Before initializing the SDK, make sure you have:

  • A TikTok Business account.
  • Your Access Token.
  • Your App ID.
  • Your TikTok App ID (single ID or multiple IDs).

Official TikTok docs:

  • TikTok Business SDK / App Events docs: https://business-api.tiktok.com/portal/docs?id=1739584951798785

Quick Start

Initialize once when your app launches.

import { Application } from '@nativescript/core';
import { BusinessSdk, Config, LogLevel } from '@nstudio/nativescript-tiktok';

Application.on(Application.launchEvent, async () => {
	const config = new Config(
		'<TIKTOK_ACCESS_TOKEN>',
		'<TIKTOK_APP_ID>',
		'<TIKTOK_SDK_APP_ID>'
	)
		.setLogLevel(LogLevel.Warning)
		.setFlushTimeInterval(15);

	config.debugMode = false;
	config.autoTracking = true;

	await BusinessSdk.initialize(config);
});

If you disable auto-tracking (config.autoTracking = false), start tracking manually:

BusinessSdk.startTrack();

Configuration

Config constructor:

new Config(accessToken: string, appId: string, tiktokAppId: string | string[])

Config properties

  • paymentTracking: boolean
  • debugMode: boolean
  • autoTracking: boolean
  • launchTracking: boolean
  • retentionTracking: boolean
  • installTracking: boolean

Config methods

  • setFlushTimeInterval(seconds: number): this
  • disableAutoEnhancedDataPostbackEvent(): this
  • setIsLowPerformanceDevice(isLowPerformanceDevice: boolean): this
  • setLogLevel(level: LogLevel): this

Log levels

enum LogLevel {
	None = 0,
	Info = 1,
	Warning = 2,
	Debug = 3,
}

User Identity

Use identify to associate events with your user profile:

BusinessSdk.identify(
	'external-user-id',
	'username',
	'[email protected]',
	'+11234567890'
);

Clear identity with:

BusinessSdk.logout();

Event Tracking

The plugin supports generic and strongly-typed event tracking.

BusinessSdk.trackEvent({
	eventName: 'registration',
	eventId: 'evt-001',
	event: {
		type: 'registration',
		method: 'email',
	},
});

Standard event names

Use StandardEvent for type-safe event names.

import { StandardEvent } from '@nstudio/nativescript-tiktok';

BusinessSdk.trackEvent({
	eventName: StandardEvent.Purchase,
	eventId: 'order-1001',
	event: {
		type: StandardEvent.Purchase,
		content_type: 'product',
		content_id: 'sku_42',
		description: 'Premium Plan',
		currency: 'USD',
		value: '9.99',
	},
});

Content events

The following event types require content-related fields:

  • addToCart
  • addToWishlist
  • checkout
  • purchase
  • viewContent

Required fields for those events:

  • content_type: string
  • content_id: string
  • description: string
  • currency: string
  • value: string

Impression-level ad revenue events

The plugin supports impression revenue payload types for:

  • applovin_max_sdk
  • ironsource_sdk
  • admob_sdk

Example:

BusinessSdk.trackEvent({
	eventName: StandardEvent.ImpressionLevelAdRevenue,
	event: {
		type: StandardEvent.ImpressionLevelAdRevenue,
		revenue: '0.032',
		placement: 'main_feed',
		device_ad_mediation_platform: 'admob_sdk',
		value: '0.032',
		currency_code: 'USD',
		precision: 'ESTIMATED',
		ad_unit_id: 'unit-1',
		ad_source_name: 'admob',
		ad_source_id: 'source-1',
		ad_source_instance_name: 'instance-a',
		ad_source_instance_id: 'instance-1',
		mediation_group_name: 'default-group',
		mediation_ab_test_name: 'test-a',
		mediation_ab_test_variant: 'A',
		ad_format: 'interstitial',
	},
});

Deferred Deep Link

const deepLink = await BusinessSdk.fetchDeferredDeepLinkData();
console.log('Deferred deep link:', deepLink);

Manual Flush

BusinessSdk.flush();

API Surface

Main exports:

  • BusinessSdk
  • Config
  • LogLevel
  • StandardEvent
  • Events and event payload interfaces

Full typings: index.d.ts

Platform Notes

  • iOS SDK is integrated via Swift Package Manager (tiktok-business-ios-sdk, currently 1.6.0).
  • Android SDK dependency currently uses com.github.tiktok:tiktok-business-android-sdk:1.6.0.

License

Apache License Version 2.0