0.0.1 • Published 6 months ago

@yaakadev/nest-yousign v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Nest YouSign

Wrapper of the YouSign API using NestJS. Only some parts of the api are currently implemented and the rest might need to be added in the future.

Installation

$ npm install --save @yaakadev/nest-yousign

You can now import the module in your app.module.ts:

YouSignModule.forRoot({
    apiUrl: <API_URL>,
    apiKey: <API_KEY>
}),

or

YouSignModule.forRootAsync({
      inject: [ConfigService],
      imports: [ConfigModule],
      useFactory: (configService: ConfigService) => ({
        apiUrl: configService.get<string>('YOU_SIGN_API_URL'),
        apiKey: configService.get<string>('YOU_SIGN_API_KEY'),
      }),
    }),

You can now import the YouSignService anywhere in your code.

Examples

this._youSignService.createSignatureRequest({
    name: `Signature Request ${requestName}`,
    delivery_mode: YouSignSignatureRequestDeliveryMode.email,
    timezone: 'Europe/Paris',
    ordered_signers: false
});
this._youSignService.uploadDocument(
    requestId,
    'signable_document',
    file,
);
this._youSignService.addSignerToSignatureRequest(requestId, {
    ...
});
this._youSignService.activateRequest(requestId);