Neatly Prepared Mustache

    @frontend-sdk/rebuy
    TypeScript icon, indicating that this package has built-in type declarations

    0.25.1 • Public • Published

    Rebuy

    Rebuy integration for Shogun Frontend.

    Rebuy creates intelligent shopping experience with data-driven persoanlization and providing merchandizing solutions.

    ⚠️ This package runs on Shogun Frontend and is in customer Beta. It might not currently support all ecommerce platforms or cover all use cases.

    Rebuy website →

    Installation

    yarn add @frontend-sdk/rebuy

    npm install @frontend-sdk/rebuy


    Rebuy Widgets

    Inject Rebuy's script with your Shopify domain (….myshopify.com):

    import { useRebuyWidget } from '@frontend-sdk/rebuy'
    
    const RebuyWidget = ({ widgetId }) => {
      useRebuyWidget('<insert Shopify domain>')
    
      return (
        <div
          data-rebuy-id="widgetId"
          data-rebuy-shopify-product-ids="<Product ID>"
        </div>
      )
    }

    Rebuy Data

    You can also manually display data from any of Rebuy's API endpoints.

    import { useRebuyData } from '@frontend-sdk/rebuy'
    
    const RebuyData = () => {
      const { loading, error, data } = useRebuyData('<endpoint>')
    
      if (loading) {
        return <h1>Loading…</h1>
      }
      if (typeof error !== 'undefined') {
        return <h1>Error</h1>
      }
      if (typeof data === 'undefined') {
        return <h1>Wrong data</h1>
      }
    
      return (
        <>
          <ul>
            {data.data.map((product) => (
              <li key={product.title}>{product.title}</li>
            ))}
          </ul>
        </>
      )
    }

    Links

    Keywords

    none

    Install

    npm i @frontend-sdk/rebuy

    DownloadsWeekly Downloads

    1

    Version

    0.25.1

    License

    MIT

    Unpacked Size

    5.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • carlos.souza
    • georgy-nemtsov
    • edengetshogun
    • shogun-engineering
    • nino-majder
    • william-shogun
    • pamelakchen
    • andynguyen-shogun
    • hugo-shogun
    • ivins
    • luiz_shogun
    • caroline-getshogun.com
    • shogun-admin