TypeScript · Integration

Add E-Signatures to NestJS

Send documents for legally binding e-signature from your NestJS application. One endpoint, no SDK required.

Quick start

  1. Get an API key from signb.ee (free, no credit card)
  2. Set SIGNBEE_API_KEY in your environment
  3. Add the code below to your app

NestJS example

TypeScript
@Controller('contracts')
export class ContractsController {
  constructor(private readonly http: HttpService) {}

  @Post('send')
  async send(@Body() body: SendContractDto) {
    const { data } = await firstValueFrom(
      this.http.post('https://signb.ee/api/send', body, {
        headers: {
          Authorization: `Bearer ${process.env.SIGNBEE_API_KEY}`,
        },
      }),
    );
    return data;
  }
}

What happens

  1. Your app sends markdown or a PDF URL to Signbee
  2. Signbee generates a PDF (if markdown) and emails the recipient a signing link
  3. Recipient signs — both parties receive the signed PDF with SHA-256 certificate

Also works with AI agents

Install the MCP server to let Claude, Cursor, or Windsurf send documents directly:

npx -y signbee-mcp

Integration details

NestJS is a TypeScript-first Node.js framework with Angular-inspired architecture. Its module system, dependency injection, and decorator-based routing make it ideal for building structured, maintainable e-signature services.

HttpModule: NestJS provides HttpModule (wrapping Axios) for HTTP calls. Register it in your module's imports array. The HttpService is injected into controllers via the constructor, providing a reactive (RxJS) API for HTTP requests.

Module architecture: Create a dedicated SignbeeModule containing a SignbeeService (for API calls), a SignbeeController (for route handling), and DTOs (for request validation). This follows NestJS's modular architecture and makes the e-signature functionality reusable across your application.

Validation pipes: Use NestJS's ValidationPipe with class-validator decorators on your DTOs. This provides automatic request validation with detailed error messages. Decorate SendContractDto fields with @IsString(), @IsEmail(), and @IsNotEmpty().

Guards and interceptors: Protect your contract-sending endpoint with NestJS guards (authentication, authorization) and interceptors (logging, transformation). These cross-cutting concerns are separated from business logic.

Microservices: NestJS supports multiple transport layers (TCP, Redis, NATS, MQTT, Kafka). If your signing service is part of a microservices architecture, expose it via any transport layer while keeping the Signbee API call identical.

FAQs

How do I add e-signatures to NestJS?

Get an API key from signb.ee (free, no credit card), set SIGNBEE_API_KEY in your environment, and add a single POST request to your NestJS application. The recipient receives a signing link by email, signs on any device, and both parties get a SHA-256 certified PDF.

Does Signbee work with NestJS?

Yes. Signbee is a REST API that works with any language or framework including NestJS. Send a POST request with your document content, sender and recipient details, and Signbee handles the entire signing ceremony. No SDK required.

How does NestJS handle HTTP calls to Signbee?

NestJS provides HttpModule (wrapping Axios) with a reactive API. Import HttpModule in your module, inject HttpService in your controller or service, and use firstValueFrom() to convert the Observable to a Promise. The API call is type-safe and integrates with NestJS's dependency injection.

Should I create a separate module for Signbee?

Yes. Create a SignbeeModule with a SignbeeService (API calls), controller (routes), and DTOs (validation). This follows NestJS's modular architecture, makes the service reusable, and keeps your codebase organised.

Can I validate contract requests in NestJS?

Yes. Use class-validator decorators on your DTO classes (@IsString, @IsEmail, @IsNotEmpty) and enable NestJS's global ValidationPipe. Invalid requests automatically receive detailed 400 error responses.

Related resources

Try Signbee — free, no credit card.