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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fortepayments/forte-react-native-sdk

v1.0.1

Published

Simplify mobile payments for your customers with CSG Forte React Native SDK. Get up and running quickly while keeping control of the UX of your web, native Android, and iOS apps. Our PCI-compliant architecture is designed to protect your customer’s valuab

Downloads

10

Readme

Forte React Native SDK

Simplify mobile payments for your customers with CSG Forte React Native SDK. Get up and running quickly while keeping control of the UX of your web, native Android, and iOS apps. Our PCI-compliant architecture is designed to protect your customer’s valuable data.

Package Name - @fortepayments/forte-react-native-sdk
Version - 1.0.0

Required Dependencies

"react-native-web": "^0.17.5" //Only use, when you want to run this SDK in a browser

Installation

If installing from NPM repository

npm install @fortepayments/forte-react-native-sdk

How to create a new RN project with CSG Forte RN SDK

  1. Create New Project with command
npx react-native init csgfortesample --version 0.68.2
  1. Then copy the "Open Sans" fonts from example folder to your assets/fonts folder in your react native project. After that create a new file in your project named: react-native.config.js and add following contents to it:
module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ["./assets/fonts/"],
};

Then run

npx react-native link
  1. Then go to your iOS project folder and run
pod install
  1. Then replace the contents of the App.js file with the contents from the AppBarebones.js file from the example.

  2. Now run:

npm run start
  1. Then in a new terminal run
npm run ios

For Android you can run

npm run android

How to add support for RN for Web

  1. Continuing from the last section, run the following command to install required libs:
npm install -D react-dom@"^17.0.2" react-native-web@"^0.17.5" webpack@"^5.67.0" webpack-cli@"^4.10.0" webpack-dev-server@"^4.7.3" url-loader@"^4.1.1" html-webpack-plugin@"^5.5.0" babel-plugin-react-native-web@"^0.17.5" babel-loader@"^8.2.3"
  1. Then add these two lines in package script
  "build": "rm -rf dist/ && webpack --mode=production --config webpack.config.js",
  "web": "webpack serve --mode=development --config webpack.config.js"
  1. Then Create a new file in your project named: index.html and add following contents to it:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>CSG Forte</title>
    <style>
      @import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");
      #app-root {
        display: flex;
        flex: 1 1 100%;
        height: 100vh;
      }
    </style>
  </head>
  <body>
    <div id="app-root"></div>
  </body>
</html>
  1. Then Create a new file in your project named: index.web.js and add following contents to it: (here APP is the Main component of the project)
import { AppRegistry } from "react-native";
import { name as appName } from "./app.json";
import App from "./App";
if (module.hot) {
  module.hot.accept();
}
AppRegistry.registerComponent(appName, () => App);
AppRegistry.runApplication(appName, {
  initialProps: {},
  rootTag: document.getElementById("app-root"),
});
  1. Then Create a new file in your project named: webpack.config.js and add following contents to it:
const path = require("path");

const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");

const appDirectory = path.resolve(__dirname);
const { presets } = require(`${appDirectory}/babel.config.js`);

const compileNodeModules = [
  "react-native-web",
  "@fortepayments/forte-react-native-sdk",
].map((moduleName) => path.resolve(appDirectory, `node_modules/${moduleName}`));

const babelLoaderConfiguration = {
  test: /\.(sass|less|css)|.ttf$|.js$|tsx?$/,
  // Add every directory that needs to be compiled by Babel during the build.
  include: [
    path.resolve(__dirname, "index.web.js"), // Entry to your application
    path.resolve(__dirname, "App.js"), // Change this to your main App file
    path.resolve(__dirname, "src"),
    ...compileNodeModules,
  ],
  use: {
    loader: "babel-loader",
    options: {
      cacheDirectory: true,
      presets,
      plugins: ["react-native-web"],
    },
  },
};

const imageLoaderConfiguration = {
  test: /\.(gif|jpe?g|png)$/,
  use: {
    loader: "url-loader",
    options: {
      name: "[name].[ext]",
    },
  },
};

module.exports = {
  entry: {
    app: path.join(__dirname, "index.web.js"),
  },
  output: {
    path: path.resolve(appDirectory, "dist"),
    publicPath: "/",
    filename: "rnw_blogpost.bundle.js",
  },
  resolve: {
    extensions: [".web.tsx", ".web.ts", ".tsx", ".ts", ".web.js", ".js"],
    alias: {
      "react-native$": "react-native-web",
    },
  },
  module: {
    rules: [babelLoaderConfiguration, imageLoaderConfiguration],
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.join(__dirname, "index.html"),
    }),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.DefinePlugin({
      __DEV__: JSON.stringify(true),
    }),
  ],
};
  1. Now Run
npm run web
  1. Then look for the line like Loopback: http://localhost:8080/ in the output and access the web application on the given address.