We noticed that DocuSign provides a JavaScript library that seems to enhance the embedding process. However, our project is built with Angular and TypeScript, and we couldn't find documentation specific to TypeScript integration. Could you please share any documentation, resources, or tutorials that could guide us in integrating the library effectively in our environment? Your assistance would be immensely helpful.
Hello you can find this Steps to Integrate DocuSign with Angular and TypeScript
-
Install the DocuSign SDK: First, you need to install the DocuSign SDK via npm. You can do this by running:
npm install docusign-esign
-
Create a Service for DocuSign: Create an Angular service to handle DocuSign-related operations. This service will encapsulate the logic for interacting with the DocuSign API.
TypeScriptimport { Injectable } from '@angular/core';
import * as docusign from 'docusign-esign';
@Injectable({
providedIn: 'root'
})
export class DocusignService {
private apiClient: docusign.ApiClient;
constructor() {
this.apiClient = new docusign.ApiClient();
this.apiClient.setBasePath('https://demo.docusign.net/restapi');
// Set your DocuSign credentials here
this.apiClient.addDefaultHeader('Authorization', 'Bearer YOUR_ACCESS_TOKEN');
}
// Example method to create an envelope
public async createEnvelope(envelopeDefinition: docusign.EnvelopeDefinition): Promise<docusign.EnvelopeSummary> {
const envelopesApi = new docusign.EnvelopesApi(this.apiClient);
const accountId = 'YOUR_ACCOUNT_ID';
return await envelopesApi.createEnvelope(accountId, { envelopeDefinition });
}
} -
Use the Service in Your Components: Inject the
TypeScriptDocusignService
into your Angular components and use it to interact with the DocuSign API.import { Component } from '@angular/core';
import { DocusignService } from './docusign.service';
import * as docusign from 'docusign-esign';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: U'./app.component.css']
})
export class AppComponent {
constructor(private docusignService: DocusignService) {}
async createEnvelope() {
const envelopeDefinition: docusign.EnvelopeDefinition = {
// Define your envelope here
};
const result = await this.docusignService.createEnvelope(envelopeDefinition);
console.log(result);
}
}
Additional Resources
- DocuSign Developer Center: The DocuSign Developer Center provides comprehensive guides and API references : https://developers.docusign.com/.
- DocuSign API Documentation: The API documentation includes detailed information on endpoints and usage : https://developers.docusign.com/docs/esign-rest-api/reference/.
These steps should help you get started with integrating DocuSign into your Angular and TypeScript project.
Thank you so much and if you need any help you can raise a support case anytime at https://support.docusign.com
Thank you very much for your response, I understand that the code example you sent me is to generate a signed envelope, but my problem is that I can generate the envelope in the back of my application as well as the embedded view, now what I want is to show that view, currently I am doing it with an iframe but I want to show it with the docusign library for javascript, but I can't find a way to do it with typescript and angular.
Reply
Sign up
Already have an account? Login
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationDocusign Community
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.