Skip to content

fiatconnect/fiatconnect-widget

Repository files navigation

FiatConnect Widget

A web client for FiatConnect.

Deployment

Deployment details differ by provider. You may find this resource helpful.

FiatConnect Provider requirements

The FiatConnect Widget is intended to be an interface for any server offering a FiatConnect-compliant API. Besides implementing a compliant API, the server must also be configured to allow cross-origin requests from the domain where the widget is hosted, and must mark session cookies as SameSite=None; Secure to allow the widget to use them.

For more information on these requirements, you may consult these resources:

Adding a FiatConnect Provider to the widget

Update all the constants in src/providerConfig.ts with the new provider's information.

Usage

Once deployed, the FiatConnect Widget may be used to help users complete FiatConnect transfers. A client application is expected to:

  • first query some FiatConnect server(s) directly for quotes,
  • present the quote(s) information to the end user to choose from,
  • then direct the user to the FiatConnect Widget to complete the transfer

The widget requires several query parameters describing the quote, which may be found in the zod schema queryParamsSchema located in src/schema.ts. For an example of how to use a FiatConnect quote to generate these query parameters, see scripts/generateWidgetUrl.ts (which may also come in handy for manual testing).

Implementation status

Fiat Account Schemas supported

KYC Schemas supported

Transfer Types supported

  • Transfers In
  • Transfers Out

UserActionDetails Schemas supported

Development

This project was bootstrapped with Create React App.

Environment variables

Environment variables are loaded in src/config.ts. See that module for details.

See here for advice on setting environment variables for development or for use in a production build.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Runs jest tests.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

yarn eject

Note: this is a one-way operation. Once you eject, you can’t go back!

For many overrides that would otherwise require you to eject, you can use react-app-rewired, and just update config-overrides.js. If you get compilation errors citing missing Webpack polyfills on v5, try this before ejecting.

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.