CustomJS

Turn conversations into documents with AI-powered CustomJS automation

Your AI agent generates PDFs, captures webpage screenshots, merges documents, and runs browser automation scripts through CustomJS, all triggered by customer requests. Invoices, reports, and visual snapshots produced on demand without developer involvement.

Chosen by 800+ global brands across industries

Document generation inside every conversation

From converting HTML into polished PDFs to snapping screenshots of any URL, your agent executes CustomJS operations that would normally require a developer and a deployment pipeline.

CustomJS

Use Cases

Documents on demand, no code required

Practical scenarios where AI agents use CustomJS to produce documents, capture visuals, and automate browser tasks for customers and internal teams.

Instant Invoice Generation for Customers

A customer messages 'I need an invoice for my last three orders.' The AI agent gathers order data from your system, renders an HTML invoice template with line items, totals, and tax calculations, and sends it to CustomJS for PDF conversion. The customer receives a downloadable invoice within the conversation. No finance team intervention, no 24-hour wait.

Visual Bug Reports with Automated Screenshots

A customer reports 'Your pricing page looks broken on mobile.' The AI agent captures a screenshot of the URL through CustomJS, attaches it to an internal ticket, and confirms to the customer that the visual evidence has been logged. Your development team gets a screenshot with the bug report instead of vague descriptions.

Multi-Document Packages Assembled on the Fly

A sales prospect asks for a proposal package including the contract, pricing sheet, and case study. The AI agent collects the three PDF URLs, sends them to CustomJS for merging, and delivers a single combined document. The prospect gets everything in one file. Your sales rep never opens a PDF editor.

Try
CustomJS

CustomJS

FAQs

Frequently Asked Questions

How does the AI agent generate a PDF from HTML through CustomJS?

The agent calls CustomJS's HTML to PDF endpoint, passing the HTML string and a JavaScript snippet that invokes the HTML2PDF converter. CustomJS renders the HTML in a headless browser and returns binary PDF data. The agent can then share the document as a download link or attach it to the conversation. CSS styling, images, and fonts are all preserved in the output.

Can the agent merge PDFs stored at different URLs into one file?

Yes. The agent sends an array of PDF URLs to CustomJS's merge endpoint along with a JavaScript snippet that downloads each file and combines them using the PDF_MERGE utility. The result is a single merged PDF returned as binary data. You can merge contracts, invoices, appendices, or any combination of PDF documents in one API call.

What screenshot resolution and format does CustomJS produce?

CustomJS captures screenshots in PNG format at the page's native resolution. The Puppeteer-based renderer captures the full page or viewport depending on your script configuration. For higher resolution captures, you can set device scale factor in your Puppeteer script. The resulting images are suitable for documentation, bug reports, and visual QA.

Does Tars store the generated PDFs or screenshots?

No. CustomJS returns the binary data to Tars, which passes it to the conversation as a download or inline preview. Tars does not maintain a persistent file storage of generated documents. If you need long-term storage, configure your agent to upload files to your own cloud storage service after generation.

Can the agent run arbitrary Puppeteer scripts, or are there restrictions?

The agent can execute Puppeteer scripts that CustomJS supports, including page navigation, form interactions, element waiting, and screenshot capture. Scripts run in CustomJS's sandboxed environment with their Node.js runtime. Network access follows CustomJS's security policies. You control which scripts your agent is allowed to run through your Tars configuration.

How is using CustomJS through Tars different from calling the API directly?

Calling the API directly requires developer involvement for every document request. With Tars, your sales team can ask 'Generate a proposal PDF' or your customer can request 'Send me my invoice,' and the agent handles the API call, HTML templating, and file delivery automatically. No engineering tickets, no deployment cycles.

What happens if the HTML content has rendering errors during PDF generation?

CustomJS uses a Chromium-based renderer, so it handles HTML and CSS the same way a modern browser would. If there are rendering issues like missing images or broken CSS, the PDF will reflect those problems. The agent can verify the output and notify your team if the generated file appears incomplete or malformed.

Is there a file size limit for PDF merging through CustomJS?

CustomJS processes PDF merges based on the total size of input files and your plan limits. Free plans support up to 600 operations per month. For large document packages, ensure individual PDFs are under the API's payload limits. The agent will report back if a merge operation fails due to size constraints so your team can split the request.

How to add Tools to your AI Agent

Supercharge your AI Agent with Tool Integrations

Don't limit your AI Agent to basic conversations. Watch how to configure and add powerful tools making your agent smarter and more functional.

Real results, real customers, real stories

“We're saving an average of 4,000+ calls a month.”
Implementing an Agent revolutionized our customer service channels and our service to Indiana business owners. We're saving an average of 4,000+ calls a month and can now provide 24x7x365 customer service️ along with our business services.
Lindsey Roark Mayes
Ex-Director of SOS IT (State of Indiana)
“Cutting down on staff needing to email back.”
Since our launch of Tars Agents, we've had more than 5k interactions with them from individuals on the website. We saw prospects interacting with the Agent regarding application timelines, tuition, curriculum, and other items that may come through an email. This provides another avenue of access to our team while cutting down on staff needing to email back.
Levi Eastwood
Marketing Director of UCI Merage School
“Powerful tool - and there's so much more still to explore!”
I love the flexibility of the TARS chatbot design tool. The ability to drop in a new gambit and easily de-link and re-link gambits before and after it saves HOURS of time lost if I had to regenerate from scratch. TARS stands out for its flexibility, consistent performance, and outstanding support.
Aaron Rittmaster
Founder
“I like the product.”
Takes those boring forms and allows you to make the collecting of customer information enjoyable for the user. It has a lot of value and I see the company constantly working on improving it.
Pierre Rattini
Director of Marketing
“Very responsive and supportive Team”
I love how supportive and responsive the team members are. The chatbots are not difficult to build once you have an idea of what you are doing, and this is so based on the backend work Tars has completed. Also, they are flexible to the clients' requests.
Keisha Cameron
Product Manager
“Easy for cooperation and open to agreement.”
One of the biggest qualities of TARS is their ability to truly understand their clients' needs. They took the time to thoroughly assess our requirements, offering valuable insights and recommendations that we hadn't even considered. This level of personalized attention made a significant difference in the success of our project.
Milica Petrovic
Customer Care Project Associate
“Great service”
The guys at Tars are so passionate about bots and maximum engagement. Tars is overall a great product with really nice people there to help me engage and automate conversations I would have otherwise missed.
Nigel Gosling
Health Coach
“Best in class for lead generation”
TARS is an essential tool within our lead gen strategy. I started to use it a couple years ago, and the platform evolved to focus on results. You can integrate your Google Analytics, Facebook Pixel, and AdWords conversion tag to track results and measure your campaign. You can also integrate with Zapier, which opens a lot of possibilities. Compared with static landing pages, we have seen an increase in conversions and more engagement.
Leonardo Wolff
Founder
“Very professional and cooperative”
Building an automated chat that our customers actually used and reduced calls amount.
Maryam Alhaddad
Customer Journey Designer
“Flexibility and good service”
Tars platform is very flexible, so you can do pretty much any flux you desire. Also integrates with any third party through APIs with a very simple and easy-to-use interface. Also tars team is great! Always at disposal and brings suggestions and solutions for any issue encountered during the process of building the chatbot.
Lucas Von Lachmann
Process Manager
“Deserved The title of the Best Chatbot of the Year”
If you are building chatbots, you cannot go wrong with TARS. I have been with this company since their beginning. Seen how they have grown. I have tested a lot of bots, but this one is still the best out there. We use WhatsApp a lot for our business. And what I like best is that I can have 1 chatbot for website and for my WhatsApp. I especially appreciate their support team as well. Whenever I am stuck, they quickly reply to my questions.
MJ Felix
Chairman
“Advanced integration, easy to use, and very customizable.”
This chatbot does everything from AI integration to complete customization and is excellent for lead conversion in most industries. I think the pre-formatted templates are an excellent boost to get started quickly. The team is also excellent.
Rachel Rowling
Chief Operating Officer
“The chatbot implementation has exceeded expectations!”
The implementation has delivered 24/7 customer support and is proving its value by reducing Contact center calls by around 5% in just four months of operation. Beyond enhancing the e-care experience, the chatbot is driving impressive business results, achieving a remarkable 20% month-on-month growth.
Victor Pereira
Customer Care and CX Manager
“We're saving an average of 4,000+ calls a month.”
Implementing an Agent revolutionized our customer service channels and our service to Indiana business owners. We're saving an average of 4,000+ calls a month and can now provide 24x7x365 customer service️ along with our business services.
Lindsey Roark Mayes
Ex-Director of SOS IT (State of Indiana)
“Cutting down on staff needing to email back.”
Since our launch of Tars Agents, we've had more than 5k interactions with them from individuals on the website. We saw prospects interacting with the Agent regarding application timelines, tuition, curriculum, and other items that may come through an email. This provides another avenue of access to our team while cutting down on staff needing to email back.
Levi Eastwood
Marketing Director of UCI Merage School
“Powerful tool - and there's so much more still to explore!”
I love the flexibility of the TARS chatbot design tool. The ability to drop in a new gambit and easily de-link and re-link gambits before and after it saves HOURS of time lost if I had to regenerate from scratch. TARS stands out for its flexibility, consistent performance, and outstanding support.
Aaron Rittmaster
Founder
“I like the product.”
Takes those boring forms and allows you to make the collecting of customer information enjoyable for the user. It has a lot of value and I see the company constantly working on improving it.
Pierre Rattini
Director of Marketing
“Very responsive and supportive Team”
I love how supportive and responsive the team members are. The chatbots are not difficult to build once you have an idea of what you are doing, and this is so based on the backend work Tars has completed. Also, they are flexible to the clients' requests.
Keisha Cameron
Product Manager
“Easy for cooperation and open to agreement.”
One of the biggest qualities of TARS is their ability to truly understand their clients' needs. They took the time to thoroughly assess our requirements, offering valuable insights and recommendations that we hadn't even considered. This level of personalized attention made a significant difference in the success of our project.
Milica Petrovic
Customer Care Project Associate
“Great service”
The guys at Tars are so passionate about bots and maximum engagement. Tars is overall a great product with really nice people there to help me engage and automate conversations I would have otherwise missed.
Nigel Gosling
Health Coach
“Best in class for lead generation”
TARS is an essential tool within our lead gen strategy. I started to use it a couple years ago, and the platform evolved to focus on results. You can integrate your Google Analytics, Facebook Pixel, and AdWords conversion tag to track results and measure your campaign. You can also integrate with Zapier, which opens a lot of possibilities. Compared with static landing pages, we have seen an increase in conversions and more engagement.
Leonardo Wolff
Founder
“Very professional and cooperative”
Building an automated chat that our customers actually used and reduced calls amount.
Maryam Alhaddad
Customer Journey Designer
“Flexibility and good service”
Tars platform is very flexible, so you can do pretty much any flux you desire. Also integrates with any third party through APIs with a very simple and easy-to-use interface. Also tars team is great! Always at disposal and brings suggestions and solutions for any issue encountered during the process of building the chatbot.
Lucas Von Lachmann
Process Manager
“Deserved The title of the Best Chatbot of the Year”
If you are building chatbots, you cannot go wrong with TARS. I have been with this company since their beginning. Seen how they have grown. I have tested a lot of bots, but this one is still the best out there. We use WhatsApp a lot for our business. And what I like best is that I can have 1 chatbot for website and for my WhatsApp. I especially appreciate their support team as well. Whenever I am stuck, they quickly reply to my questions.
MJ Felix
Chairman
“Advanced integration, easy to use, and very customizable.”
This chatbot does everything from AI integration to complete customization and is excellent for lead conversion in most industries. I think the pre-formatted templates are an excellent boost to get started quickly. The team is also excellent.
Rachel Rowling
Chief Operating Officer
“The chatbot implementation has exceeded expectations!”
The implementation has delivered 24/7 customer support and is proving its value by reducing Contact center calls by around 5% in just four months of operation. Beyond enhancing the e-care experience, the chatbot is driving impressive business results, achieving a remarkable 20% month-on-month growth.
Victor Pereira
Customer Care and CX Manager

Privacy & Security

We’ll never let you lose sleep over privacy and security concerns

At Tars, we take privacy and security very seriously. We are compliant with GDPR, ISO, SOC 2, and HIPAA.

GDPR
ISO
SOC 2
HIPAA

Still scrolling? We both know you're interested.

Let's chat about AI Agents the old-fashioned way. Get a demo tailored to your requirements.

Schedule a Demo