Giter Club home page Giter Club logo

eg-02-react-implicit-grant's Introduction

Example 2: OAuth Implicit Grant and React example

Repository: eg-02-react-implicit-grant

Introduction

See the DocuSign Developer blog post for more information about this example.

This example React application demonstrates:

  • Using the OAuth Implicit Grant flow with DocuSign.
  • Using DocuSign from a React application. The application was bootstrapped with Create React App. It has not been ejected from the bootstrap process.
  • Embedded signing from a React application.
  • Listing envelopes in an account from a React application.

Installation

Requirements

See the CORS example repository for information on creating a private CORS gateway.

Installation steps

Download or clone this repository. Then:

cd eg-02-react-implicit-grant
npm install

There are two ways to configure the example's settings:

  1. Edit the dsConfig.js file in the root directory of the example.

  2. Set the environment variables before running the example with the React bootstrap server. Set (and export) these environment variables:

    REACT_APP_DS_CLIENT_ID -- the app's Integration Key

    REACT_APP_DS_OAUTH_CORS -- the URL for a CORS gateway for the DocuSign OAuth service.

    REACT_APP_DS_API_CORS -- the URL for a CORS gateway for the DocuSign esignature REST API service.

    REACT_APP_DS_REDIRECT_URI -- the URL for the application. This URL is added to the configuration settings of the Integration Key.

    The Create React app bootstrap process will automatically execute the file .env.development if it is present in the root directory. The file should include:

    REACT_APP_DS_CLIENT_ID="xxxxx"
    export REACT_APP_DS_CLIENT_ID

    ... etc.

Setting environment variables enables you to configure the software without including your private information in the repository.

Creating the Integration Key

Your DocuSign Integration Key must be configured for an OAuth Implicit Grant flow:

  • Check the This is a mobile app. setting.

  • Create a Redirect URIs entry for the application's URL. This URL is also configured in the dsConfig.js file or the environment variables file.

    Note: If the application is not located at your server's root directory, then you will need to set the BrowserRouter's basename property in the index.js file.

Running the application

Development mode

Start the development server:

cd eg-02-react-implicit-grant
npm start

Then open a browser to http://localhost:3000

Production

Follow the documentation for building and deploying the application.

Debugging

  • Since the Create React App toolchain is used for this application, Debugging in the editor is supported. Or your browser's standard inspector/debugger can be used.
  • While in development mode, the application supports the Redux DevTools Extension for Chrome, Firefox and other browsers.

Support, Contributions, License

Submit support questions to StackOverflow. Use tag docusignapi.

Contributions via Pull Requests are appreciated. All contributions must use the MIT License.

This repository uses the MIT license, see the LICENSE file.

eg-02-react-implicit-grant's People

Contributors

larryklugerds avatar

Watchers

 avatar

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.