Skip to content

Latest commit

 

History

History

typescript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Anvil usage examples in TypeScript

Welcome to Anvil API usage examples in TypeScript! There are example scripts for the following API actions:

Usage

All scripts will require that you have an Anvil API key. See the getting started documentation for help grabbing your API key.

When you have your API key, copy .env.example in this folder to .env, then set ANVIL_API_KEY to your API key. Your .env will look like this:

ANVIL_API_KEY=yourAPIKey2uzgMH0ps4cyQyadhA2Wdt

Each script is set up to be runnable with minimal input. Once you have an API key, you can clone this repo and run the example scripts from this directory.

Once you have this repo cloned, cd into this typescript directory and install the dependencies:

cd typescript
yarn install

Scripts will output filled and generated PDFs into the output directory.

Fill a PDF template:

$ yarn ts-node examples/fill-pdf.ts

Generate a PDF from HTML and CSS:

$ yarn ts-node examples/generate-html-to-pdf.ts

Generate a PDF from Markdown:

$ yarn ts-node examples/generate-markdown-to-pdf.ts

Creating an e-sign packet:

$ yarn ts-node examples/create-etch-e-sign-packet.ts <[email protected]>

Start and update workflow submissions:

$ yarn ts-node examples/create-update-workflow-submission.ts <your-org-slug>

Make an arbitrary GraphQL request:

$ yarn ts-node examples/make-graphql-request.ts