# Custom integration with DocuSign

**URL:** <https://community.hubspot.com/t/custom-integration-with-docusign/81451>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [May 17, 2023, 11:41pm UTC](https://community.hubspot.com/t/custom-integration-with-docusign/81451 "2023-05-17T23:41:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![test120](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@test120](https://community.hubspot.com/u/test120)\
**Post date:** [May 17, 2023, 11:41pm UTC](https://community.hubspot.com/t/custom-integration-with-docusign/81451/1 "2023-05-17T23:41:40Z")

</div>

I’m thinking of integrating DocuSign feature with HubSpot by writing code. Is it possible?

I know that I can use DocuSign in the HubSpot using the Marketplace app described here: [Connect HubSpot and Docusign](https://knowledge.hubspot.com/integrations/use-hubspots-integration-with-docusign)

But as this app doesn’t have enough feature that we want to use, I’d like to build the CUSTOM integration by writing the code. Is it possible? If possible, how can I do it? Please share the post or something helpful. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 18, 2023, 9:42am UTC](https://community.hubspot.com/t/custom-integration-with-docusign/81451/2 "2023-05-18T09:42:34Z")

</div>

Hello @test120  
use the DocuSign API to create a custom integration that meets your specific needs.  
example of a Node.js script that creates a new DocuSign envelope and sends it.

```lia-code-sample
const { DocuSign } = require('docusign-esign');

const client = new DocuSign({
 clientId: '<your client ID>',
 clientSecret: '<your client secret>',
 environment: 'sandbox',
});

const envelope = new DocuSign.Envelope();

envelope.setTitle('My First Envelope');
envelope.setRecipients([
 {
 name: 'John Smith',
 email: 'john.smith@example.com',
 },
]);

envelope.setDocuments([
 {
 documentId: '1234567890',
 fileName: 'My Document.pdf',
 },
]);

client.sendEnvelope(envelope);

```

you can use it to send documents for signing in HubSpot. To do this, you will need to create a new HubSpot workflow and add a step that calls your custom integration.

---

<div class="post-metadata">

**Author:** ![test120](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@test120](https://community.hubspot.com/u/test120)\
**Post date:** [May 21, 2023, 2:43am UTC](https://community.hubspot.com/t/custom-integration-with-docusign/81451/3 "2023-05-21T02:43:54Z")

</div>

Thanks for the details. However, it seems importing the “docusign-esign”  
library is not possible according to this page:

> **[Workflows | Custom Code Actions - HubSpot docs](https://developers.hubspot.com/docs/api-reference/legacy/automation/workflow-actions/custom-code-actions)**
>
> Instructions for using custom code actions in workflows

So my next questions are like below:  
1. Are there any other ways that I can create the custom integration with  
DocuSign by using “docusign-esign” library?  
2. Is it possible to open the URL that I get from the Custom Code workflow?  
Please see the attached image. As you can see in the code, I return the  
URL. In the next action, I want to open this URL. Are there any ways to  
achieve this?  
Thanks!
