Starter code for an example client app that embeds a Docusign workflow.
It includes:
server/: Node + Express backend with Docusign OAuth and Maestro API integration for workflow management.client/: React + Vite frontend.
- Node.js 20+
- Npm 10+
- Free Docusign developer account
npm install
npm install --prefix server
npm install --prefix client- Copy the config template:
cp config.example.json config.json
- Log in to your Docusign Developer Account and navigate to the Apps and Keys page.
- Create a new application and copy the Integration Key. Paste the value in the config.json as {INTEGRATION_KEY}.
- Add the following Redirect URI for your app:
-
Click ADD SECRET KEY and save the generated key — this is your {SecretKey}.
-
Review that your
config.jsonhas all the required Docusign credentials:- Integration Key (IK): Found in your Docusign app settings
- Secret Key: Also in your app settings
- Redirect URI: Set to
http://localhost:5000/api/auth/callbackfor local development - Environment: Use
demofor Docusign sandbox,productionfor live
Example:
{ "docusign": { "integrationKey": "YOUR_INTEGRATION_KEY_HERE", "secretKey": "YOUR_SECRET_KEY_HERE", "redirectUri": "http://localhost:5000/api/auth/callback", "environment": "demo" } }
Note:
config.jsonis gitignored and should never be committed.
npm run dev- Frontend:
http://localhost:5173 - Backend:
http://localhost:5000
Server restarts automatically on file changes via nodemon.
- Click "Log in with Docusign" button on the homepage
- You'll be redirected to Docusign's login page
- After authentication, you're redirected back with an authorization code
- The app exchanges the code for an access token (server-side, secure)
- User info is displayed on the page
Scopes requested:
aow_manage- Required for Maestro APIsignature- Required for eSignature & Maestro APIextended- Ensures 30-day refresh token lifetime
npm run buildOutput: client/dist/
npm run startRuns just the Express server (frontend should be served separately).
GET /api/health- Health checkGET /api/auth/login- Returns Docusign OAuth authorization URLGET /api/auth/callback- OAuth callback handler (exchanges code for token)
.
├── client/ # React + Vite frontend
│ ├── src/
│ │ ├── App.jsx # Main component with OAuth flow
│ │ ├── App.css # Docusign branded styles
│ │ ├── main.jsx
│ │ └── ...
│ ├── index.html
│ ├── vite.config.js
│ └── package.json
├── server/ # Express backend
│ ├── index.js # Main server & API routes
│ ├── controllers/ # Route handlers
│ ├── services/ # Docusign auth/workflow services
│ └── package.json
├── config.example.json # OAuth credentials template
├── package.json # Root workspace config
└── README.md
- This starter uses the
@docusign/iam-sdk(beta) for OAuth and user management - The Authorization Code Grant (ACG) flow is used for user authentication
- Access tokens are stored in
sessionStorage(upgrade to secure HttpOnly cookies in production) - The app includes Docusign's official brand colors and typography