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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gengage-widget

v1.0.12

Published

Toggleable WebView widget with floating button for React Native

Readme

Gengage React Native Widget SDK

📖 Giriş

Bu depo, React Native projeleri için kolayca entegre edilebilen bir sohbet/ürün öneri widget’ı sunar. ChatbotWidget bileşeni, gömülü bir WebView kullanarak dış kaynaklı (iframe) içerikleri uygulamanızda yüzen bir buton aracılığıyla görüntüler. Ayrıca push bildirim izinleri ve token yönetimi için yardımcı fonksiyonlar sağlar.

SDK; TypeScript ile yazılır, dist/ klasöründe tamamen derlenmiş CommonJS çıktıları barındırır. Yayınlanan NPM paketi doğrudan üretime hazırdır.


⚡️ Hızlı Başlangıç

# Hazırlık
npm install react-native-svg
npm install react-native-webview
# Kurulum
npm install gengage-widget
# veya
yarn add gengage-widget

Bazı senaryolarda

--legacy-peer-deps

kullanılması gerekebilir.

Temel Kullanım

import React from 'react';
import { ChatbotWidget } from 'gengage-widget';

export default function App() {
  return (
    <ChatbotWidget
      accountId="YOUR_ACCOUNT_ID"
      productId="PRODUCT_ID"
      // İsteğe bağlı prop’lar
      iconSize={32}
      enableAnimations={true}
    />
  );
}

Bu kadar! Uygulamayı başlattığınızda sağ-alt köşede bir sohbet butonu görünür.


🛠️ Kurulum & Derleme Komutları

| Komut | Açıklama | |-------|----------| | npm run build | TypeScript dosyalarını dist/ klasörüne derler | | npm run dev | Dosya değişikliklerini izleyerek anlık derleme yapar | | npm run clean | dist/ klasörünü temizler |

Not: Paketi yerel olarak test etmek için npm run build komutundan sonra, proje kökünde npm pack çalıştırarak .tgz arşivi oluşturabilirsiniz.


🎛️ API Referansı

<ChatbotWidget /> Prop’ları

| Prop | Tip | Varsayılan | Açıklama | |------|-----|-----------|----------| | accountId | string | – | Gengage panelinden alınan hesap kimliği | | productId | string | – | (Opsiyonel) Ürün detay sayfasından gönderilecek SKU/ID | | style | ViewStyle | – | Dış kapsayıcının stil objesi | | webViewStyle | ViewStyle | – | İç WebView bileşeninin stili | | iconSize | number | 28 | Başlatıcı ikonun (SVG) boyutu | | buttonStyle | ViewStyle | – | Yüzen butonun stili | | iconTextStyle | TextStyle | – | İkon üzerindeki metin stili | | enableAnimations | boolean | true | Açılış/kapanış animasyonlarını kontrol eder | | onLoad | () => void | – | İframe başarıyla yüklendiğinde tetiklenir | | onError | () => void | – | Yükleme hatası oluştuğunda tetiklenir |

<WebViewWidget /> Prop’ları

Daha düşük seviyeli bileşen olup doğrudan URL alan versiyondur. ChatbotWidget bunun özel bir sarmalayıcısıdır. Ayrıntılı tip bilgisi src/types/types.ts dosyasında bulunabilir.


🔔 Bildirim Yardımcıları

utils/Notification.tsx dosyası Expo, React-Native Firebase veya react-native-push-notification kütüphanelerinden hangisinin mevcut olduğuna runtime’da karar vererek şu işlevleri sağlar:

  • requestNotificationPermission() – İzin ister, boolean döner.
  • getDevicePushToken() – Cihaz FCM/Expo push token’ını döner.
  • sendLocalNotification(payload) – Platform-bağımsız lokal bildirim gönderir.
  • triggerRemotePush(apiUrl, token, payload) – Basit HTTP POST ile backend’e push tetikleme örneği.
  • ensureDevicePushToken() – Tek satırda izin + token akışı.

📝 Lisans

ISC