Overview
The Builder Signing Server is a self-hosted Express.js application that enables remote signing of builder authentication headers. By running this server, you can keep your Builder API credentials secure on your own infrastructure while still allowing your application to sign requests.This server is designed to work with both the CLOB Client for order attribution and the Relayer Client for gasless transactions.
Why Use Remote Signing?
Remote signing provides enhanced security by:- Isolating credentials: Your Builder API keys never leave your secure server
- Centralized key management: Manage credentials in one secure location
- Reduced exposure: Client applications don’t need direct access to sensitive keys
Installation
Prerequisites
- Node.js: v18 or higher
- yarn or npm
Clone and Install
Configuration
Environment Variables
Create a.env file in the root directory with your Builder API credentials:
Security: Never commit your
.env file to version control. Add it to .gitignore to prevent accidental exposure of your credentials.Port Configuration
You can run the server on any port you choose. The default is5001, but you can change this by setting the PORT environment variable. Make sure to configure your client applications to use the same port:
Running the Server
Development Mode
For development with automatic reloading:Production Mode
Build and run the compiled version:Client Integration
With CLOB Client
Configure the CLOB client to use your signing server for order attribution:With Relayer Client
Configure the relayer client to use your signing server for gasless transactions:Production Deployment
Troubleshooting
Server Won’t Start
Issue:Error: POLY_BUILDER_API_KEY environment variable is required
Solution: Ensure your .env file contains all required variables:
POLY_BUILDER_API_KEYPOLY_BUILDER_SECRETPOLY_BUILDER_PASSPHRASE
Port Already in Use
Issue:Error: listen EADDRINUSE: address already in use :::5001
Solution: Change the port in your .env file:
Invalid Signature Errors
Issue: Client receives invalid signature errors Solution:- Verify the request body is being passed correctly as a JSON string
- Check that the path and method match exactly what the client is sending
- Ensure your server and client are using the same Builder API credentials
Source Code
The complete source code and additional examples are available on GitHub:Support
For assistance with the builder signing server:- Review the GitHub repository
- Contact support@polymarket.com