0.2.20 • Published 18 days ago

@babbage/react-prompt v0.2.20

Weekly downloads
-
License
Open BSV License
Repository
github
Last release
18 days ago

Babbage React Prompt

License

The Babbage React Prompt is a React component designed to simplify and streamline the onboarding process for users of your applications that require the Babbage MetaNet Client. It does this by ensuring that the MetaNet Client is running before rendering your application. If not, the user is greeted with an informative prompt that guides them through downloading and installing the correct MetaNet Client for their operating system.

Table of Contents

Features

  1. Onboarding Simplified: The Babbage React Prompt removes the need for users to search for setup instructions for the MetaNet Client, which can be a hurdle to adoption. It ensures the client is installed and running before your application is loaded.
  2. MetaNet Network Handling: The component handles the different versions of your application that might exist on the MetaNet's mainnet and testnet networks, making it a powerful tool for alpha and beta testing.
  3. Customization: Customize the onboarding modal with your app's name, description, author, icon, and preview images.
  4. Native App Support: Specify links to your app's native versions on platforms like iOS and Android.

Installation

To install Babbage React Prompt:

npm install @babbage/react-prompt

Usage

Wrap your app (or the part of it that requires the Babbage SDK to work) with this component. Your app will only be rendered once the Babbage MetaNet Client is running. Here is an example:

import React from 'react';
import ReactDOM from 'react-dom';
import BabbagePrompt from '@babbage/react-prompt';
import App from './App';

ReactDOM.render(
  <BabbagePrompt
    appName='Your App'
    author='Your Name'
    authorUrl='https://yourwebsite.com'
    description='This is your app description.'
    appIcon='/icon.png'
    appImages={[
      '/image1.png',
      '/image2.jpg'
    ]}
    supportedMetaNet='mainnet'
    nativeAppUrls= {{
      iOS: {
        mainnet: 'https://youriOSappMainnetlink.com',
        testnet: 'https://youriOSappTestnetlink.com'
      },
      Android: {
        mainnet: 'https://yourAndroidappMainnetlink.com',
        testnet: 'https://yourAndroidappTestnetlink.com'
      }
    }}
  >
    <App />
  </BabbagePrompt>,
  document.getElementById('root')
);

Props

Refer to the table below for the various props that can be used with the Babbage React Prompt.

Prop NameDescription
childrenYour entire React app. When Babbage is running, your app will be allowed to render. Otherwise, the React Prompt will be shown.
appNameSets the name of your app in the UI.
appIconA URL to an image to use as your app icon.
descriptionA paragraph that describes your app.
authorShown below your app name.
authorUrlIf provided, the author text becomes a clickable link that navigates to the given URL.
appImagesAn array of URLs to images that will be added to the app preview carousel.
supportedMetaNetA string indicating which networks your app supports. Use mainnet for Mainnet support only, testnet for Testnet support only, and universal for both. Any other value will be treated as mainnet (the default).
nativeAppUrlsAn object containing your native app URLs. The first level keys are: iOS, Android, Windows Phone, Windows, Mac OS. Each of these have a sub-object with keys mainnet and testnet.

Caveats

Please be aware that the Brave browser sometimes causes issues with desktop MetaNet Clients. If this occurs, the React Prompt is designed to instruct users on how to disable Brave Shields, which may impede your app's operation.

License

The code in this repository is licensed under the Open BSV License.

0.2.20

18 days ago

0.2.19

19 days ago

0.2.18

1 month ago

0.2.17

1 month ago

0.2.16

1 month ago

0.2.15

2 months ago

0.2.14

2 months ago

0.2.13

3 months ago

0.2.11

4 months ago

0.2.10

12 months ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.1.3

2 years ago

0.2.0

2 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago