TypeScript API Client Library
We've released a new TypeScript API client library: docspring-ts
We still have a docspring JS library on NPM, but our TypeScript library has a few advantages:
- Type-checking to ensure you are calling functions with the correct arguments
- Autocomplete suggestions in VS Code
- Support for modern ES6 features such as async/await
Example Usage
import { PDFApi, Configuration } from 'docspring-ts'
const config = new Configuration({
username: 'API_TOKEN_ID',
password: 'API_TOKEN_SECRET',
})
const api = new PDFApi(config)
response = api.generatePDF({
templateId: 'YOUR TEMPLATE ID',
submission: {
test: false,
data: {
first_name: 'John',
last_name: 'Smith',
favorite_color: 'Green',
},
metadata: {
example: 123,
},
},
})
console.log(response)
- You can view the source code on GitHub: DocSpring/docspring-typescript
- View the DocSpring documentation for further examples and information.
Please note that this code is automatically generated from our OpenAPI schema using OpenAPI Generator, so we cannot accept pull requests. Please send us an email at support@docspring.com if you have any feedback or run into any issues.