{"id":25553805,"url":"https://github.com/docusign/sample-app-webhooks-ruby","last_synced_at":"2025-07-11T12:33:57.654Z","repository":{"id":73374352,"uuid":"519292791","full_name":"docusign/sample-app-webhooks-ruby","owner":"docusign","description":"Webhooks Sample App is a Docusign sample application written in Ruby on Rails (server) and React (client). You can find a live instance running at ","archived":false,"fork":false,"pushed_at":"2025-03-21T23:25:25.000Z","size":1180,"stargazers_count":5,"open_issues_count":4,"forks_count":4,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-11T22:43:23.713Z","etag":null,"topics":["esignature","ruby","ruby-on-rails","webhooks"],"latest_commit_sha":null,"homepage":"https://webhooks.sampleapps.docusign.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docusign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-29T17:13:15.000Z","updated_at":"2025-02-07T22:01:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a66c7a3-ec71-41b0-9030-374bfb5b147f","html_url":"https://github.com/docusign/sample-app-webhooks-ruby","commit_stats":null,"previous_names":["docusign/sample-app-myconnectwebhook-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/docusign/sample-app-webhooks-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fsample-app-webhooks-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fsample-app-webhooks-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fsample-app-webhooks-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fsample-app-webhooks-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docusign","download_url":"https://codeload.github.com/docusign/sample-app-webhooks-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docusign%2Fsample-app-webhooks-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264806667,"owners_count":23666673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esignature","ruby","ruby-on-rails","webhooks"],"created_at":"2025-02-20T12:01:44.417Z","updated_at":"2025-07-11T12:33:57.596Z","avatar_url":"https://github.com/docusign.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby on Rails and React: Webhooks Sample App\n\n### Github repo: Webhooks Sample App\n\n## Introduction\nThe Webhooks Sample App is a Docusign sample application written in Ruby on Rails (server) and React (client). You can find a live instance running at [https://webhooks.sampleapps.docusign.com/](https://webhooks.sampleapps.docusign.com/).\n\nThe Webhooks Sample App demonstrates the following:\n\n1. **Authentication** with Docusign via [JSON Web Token (JWT) Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken).\n2. **Bulk sending multiple envelopes:** ([Source](./app/services/e_sign/bulk_sending_envelopes_service.rb))\n   This example uses the Docusign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/) to [Bulk Send](https://developers.docusign.com/docs/esign-rest-api/reference/bulkenvelopes/bulksend/) multiple envelopes based on PDF document template, and filling data dynamically.\n3. **Tracking user signing progress with the Docusign Connect webhook service.** After the request has been sent to Docusign, the app awaits for webhook requests from [Docusign Connect](https://developers.docusign.com/platform/webhooks/connect/) and displays the result on UI.\n4. **Elastic signing:** ([Source](./app/javascript/src/pages/automatedWorkflow/index.js))\n   This example demonstates signing process of a Docusign [elastic template](https://developers.docusign.com/docs/click-api/how-to/create-elastic-templates/) document.\n5. **Sending out a confirmation envelope after a successful elastic signature:** ([Source](./app/services/e_sign/send_envelope_service.rb))\n   This example uses the Docusign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/), demonstrating how to [create an envelope](https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/). The example sends an envelope based on PDF template.\n\n## Prerequisites\n\n* A Docusign developer account. Create a [free account](https://go.docusign.com/o/sandbox/).\n* A Docusign integration key (client ID) that is configured to use JSON Web Token (JWT) Grant.\n  You will need the **integration key** itself and its **RSA key pair**. Copy your **RSA key pair** into a file in your config folder `config/docusign_private_key.txt`. You must also add your application's **Redirect URI** to your integration key. To run the app locally, this should be `http://localhost:3000/auth/docusign/callback`. This [**video**](https://www.youtube.com/watch?v=GgDqa7-L0yo) demonstrates how to create an integration key (client ID) for a user application like this example.\n* [Ruby 3.1.2](https://www.ruby-lang.org/en/downloads/)\n* [Node.js](https://nodejs.org/) v16+\n\n### Required variables for `config/appsettings.yml`\n\n* **app_url** - http://localhost:3000\n* **jwt_integration_key** - The integration key is the same as the client ID\n* **impersonated_user_guid** - Your User ID\n* **signer_email** - Your API account Email\n* **signer_name** - Your API account Name\n* **authorization_server** - https://account-d.docusign.com for the development environment\n* **aud** - `account-d.docusign.com` for the development environment\n\n## Installation steps\n\n### Clone project\nClone project into folder `./sample-app-webhooks-ruby`\n```\ngit clone git@github.com:docusign/sample-app-webhooks-ruby.git\n```\n### Run command to move to project folder\n```\ncd sample-app-webhooks-ruby\n```\n\n### Create appsettings.yml file\nCopy `appsettings.example.yml` and fill it in with your settings taken from Docusign Developer Account.\n```\ncp config/appsettings.example.yml config/appsettings.yml\n```\n\n### Create a webhook listener (for local development)\nCreate a secure URL for your app to receive webhook notifications using ngrok.\n\n#### Install Ngrok Tunnel (for local development)\n```\nhttps://ngrok.com/download\n```\n#### Run Ngrok Tunnel (for local development)\n```\nngrok http 3000\n```\n#### Add your secure ngrok URL as an authorized host\n* open `config/environments/development.rb`\n* Change {NGROK_HOST} to the URL generated by ngrok in the previous step\n```\nconfig.hosts \u003c\u003c \"xxx-xx-xxx-xxx-xx.ngrok.io\"\n```\n\n### Setup your custom Docusign Connect configuration\n\n#### Using a ruby script\nThe ruby script included with this project sets up a custom Connect configuration with the same settings that the hosted app uses at https://webhooks.sampleapps.docusign.com. You'll need to provide a name for your new custom connect configuration as well as the URL to publish which, if running locally using ngrok, should follow the format `https://{YOUR_NGROK_HOST}.ngrok.io/api/docusign/trigger/do_process.json`.\n\n* Navigate to the root folder of the app\n  ```\n  cd sample-app-webhooks-ruby\n  ```\n* Run the ruby script `create_connect_configuration.rb`\n  ```\n  ruby create_connect_configuration.rb\n  ```\n* Provide the name and URL to publish for your connect configuration when prompted.\n* Check https://admindemo.docusign.com/connect to view or edit your new custom Connect configuration!\n\n#### Using the Docusign UI\n* Visit https://admindemo.docusign.com/authenticate?goTo=connect\n* Select \"ADD CONFIGURATION\" --\u003e \"Custom\"\n* Add a name for your custom Connect configuration\n* In the `URL to Publish` field enter `https://{YOUR_NGROK_HOST}.ngrok.io/api/docusign/trigger/do_process.json`. This will allow Connect to send request to your local environment.\n* subscribe to the events you wish your app to receive notifications for. Events for this app include\n\n    Envelope and Recipients:\n\n      Envelope Sent\n      Envelope Delivered\n      Recipient Auto Responded\n      Recipient Signed/Completed\n      Recipient Declined\n      Recipient Finish Later\n\n\n      Include Data:\n        Custom Fields\n        Recipients\n\n    Docusign Click:\n\n      Click Agreed\n      Click Declined\n\n\n* Select \"Enable Mutual TLS\"\n* \"SAVE CONFIGURATION\"\n\n## Running the app\n\n**NOTE:** The first time you run the app with a new client id, you must grant consent for the application to perform actions on behalf of the user. Fill in your integration key and redirect url to the following consent url template and visit `https://account-d.docusign.com/oauth/auth?response_type=code\u0026scope=signature+impersonation+click.manage+click.send\u0026client_id=#{jwt_integration_key}\u0026redirect_uri=#{redirect_uri}` to grant consent.\n\n### Running the app using docker compose\nTo build app:\n```\ndocker compose build\n```\nTo start app:\n```\ndocker compose up\n```\n\nTo prepare DB and run migrations, open new terminal and run:\n```\ndocker compose exec web rake db:create db:migrate\n```\n\nTo shutdown app - just stop the console with Ctrl+C. One should note docker containers will only be *stopped* if Ctrl+C is used. To stop environment and *remove* stopped containers, run:\n```\ndocker compose down\n```\n\n\n### Running the app manually\n\n#### Install RVM\n```\nhttps://rvm.io/rvm/install\n```\n#### Install appropriate version of ruby\n```\nrvm install ruby-3.1.2\nrvm use 3.1.2\n```\n#### Install redis\nOn Linux\n```\nsudo apt update\nsudo apt install redis-server\nsudo service redis start\n```\nOn Mac\n```\nbrew install redis\nbrew services start redis\nredis-server\n```\n\n#### Install postgresql\nOn Mac\n```\nbrew install postgresql@14\nbrew services start postgresql\n```\n\nrvm recognize ruby version and create new gemset\n#### Install bundler\n```\ngem install bundler\n```\n#### Install gems\n```\nbundle install\n```\n#### Create DB\n```\nbundle exec rake db:create\n```\n#### Migrate DB\n```\nbundle exec rake db:migrate\n```\n#### Install node modules\nUse NVM https://github.com/nvm-sh/nvm and Node.js version 16+.\n```\nyarn install\n```\n\n#### Running the Webhooks Sample App\n```\n bin/dev\n```\nOpen a browser to **http://localhost:3000**\n\n\n## License information\nThis repository uses the MIT License. See the [LICENSE](./LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocusign%2Fsample-app-webhooks-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocusign%2Fsample-app-webhooks-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocusign%2Fsample-app-webhooks-ruby/lists"}