Code Monkey home page Code Monkey logo

fcl-discovery's Introduction

Discovery

When building an dapp on Flow using @onflow/fcl, Discovery eliminates the need for dapp developers to write code to integrate their user's preferred wallet into their application. Instead, @onflow/fcl and this repo uses a secure discovery protocol that wallets can implement to connect to @onflow/fcl. The end result is dapps using @onflow/fcl automatically integrate all compatible wallets without their developers needing to write any custom code!

To read more about consuming/using this repo via FCL, visit the Discovery docs.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Then add Discovery to your FCL app:

import * as fcl from "@onflow/fcl"

fcl.config({
  "discovery.wallet": "https://fcl-discovery.onflow.org/testnet/authn",
  "discovery.authn.endpoint": "https://fcl-discovery.onflow.org/api/testnet/authn"
})

Networks

Discovery UI URLs

Environment Example
Mainnet http://localhost:3002/authn or http://localhost:3002/mainnet/authn
Testnet http://localhost:3002/testnet/authn
Previewnet http://localhost:3002/previewnet/authn
Local http://localhost:3002/local/authn
Emulator http://localhost:3002/emulator/authn

Discovery API Endpoints

Environment Example
Mainnet http://localhost:3002/api/authn or http://localhost:3002/api/mainnet/authn
Testnet http://localhost:3002/api/testnet/authn
Previewnet http://localhost:3002/api/previewnet/authn
Local http://localhost:3002/api/local/authn
Emulator http://localhost:3002/api/emulator/authn

Note: Local and emulator will return Dev Wallet as a service for developing locally with the default port of 8701. If you'd like to override the default port add ?port=0000 with the port being whatever you'd like to override it to.

More Configuration

For more configuration options, please see the documentation.

Adding a Wallet to Discovery

Flow compatible wallets wanting to add their wallets to Discovery can do so by creating a PR with the following:

  • Add your wallet's service information to the services data file
  • Please provide any metadata related to your service if required (see metadata docs)
  • Provide a demo of your wallet that can be tested and is connected to Testnet
  • Specify if your wallet is opt-in or not. Opt-in wallets are those that don't have support for authentication, authorization, and user signature services.

Before adding your wallet to Discovery, ensure your wallet meets the minimum acceptance criteria.

For more information/examples on how to build a Flow compatible wallet, check out the following links:

Documentation

To learn more about the repo, take a look at the following resources:

  • Discovery - Documentation for using Discovery with FCL.
  • FCL - Learn more about Flow's FCL
  • Next.js Documentation - This app is built with Next. Learn about Next.js features and API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.