{"id":44194020,"url":"https://github.com/templatefoxpdf/typescriptsdk","last_synced_at":"2026-04-12T22:58:57.541Z","repository":{"id":336493772,"uuid":"1149888547","full_name":"TemplateFoxPDF/typescriptsdk","owner":"TemplateFoxPDF","description":"Official TemplateFox TypeScript SDK - Generate PDFs from HTML templates via API","archived":false,"fork":false,"pushed_at":"2026-02-15T21:36:28.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-16T03:05:13.528Z","etag":null,"topics":["document-generation","html-to-pdf","invoice-generator","javascript","javascript-library","node","nodejs","pdf","pdf-api","pdf-as-a-service","pdf-generator","pdf-template","template-engine","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://pdftemplateapi.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TemplateFoxPDF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-04T16:31:15.000Z","updated_at":"2026-02-15T21:36:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TemplateFoxPDF/typescriptsdk","commit_stats":null,"previous_names":["templatefoxpdf/typescriptsdk"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/TemplateFoxPDF/typescriptsdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemplateFoxPDF%2Ftypescriptsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemplateFoxPDF%2Ftypescriptsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemplateFoxPDF%2Ftypescriptsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemplateFoxPDF%2Ftypescriptsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TemplateFoxPDF","download_url":"https://codeload.github.com/TemplateFoxPDF/typescriptsdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemplateFoxPDF%2Ftypescriptsdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31368156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["document-generation","html-to-pdf","invoice-generator","javascript","javascript-library","node","nodejs","pdf","pdf-api","pdf-as-a-service","pdf-generator","pdf-template","template-engine","typescript","typescript-library"],"created_at":"2026-02-09T18:12:12.921Z","updated_at":"2026-04-12T22:58:57.531Z","avatar_url":"https://github.com/TemplateFoxPDF.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TemplateFox TypeScript SDK\n\nOfficial TypeScript/Node.js SDK for [TemplateFox](https://templatefox.com) - Generate PDFs from HTML templates via API.\n\n[![npm version](https://badge.fury.io/js/%40templatefox%2Fsdk.svg)](https://www.npmjs.com/package/@templatefox/sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Installation\n\n```bash\nnpm install @templatefox/sdk\n```\n\nOr with yarn:\n\n```bash\nyarn add @templatefox/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { Configuration, PDFApi, CreatePdfRequest } from '@templatefox/sdk';\n\n// Initialize the client\nconst config = new Configuration({\n  apiKey: 'your-api-key',\n});\n\nconst api = new PDFApi(config);\n\n// Generate a PDF\nasync function generatePdf() {\n  const response = await api.createPdf({\n    templateId: 'YOUR_TEMPLATE_ID',\n    data: {\n      name: 'John Doe',\n      invoiceNumber: 'INV-001',\n      totalAmount: 150.00,\n    },\n  });\n\n  console.log('PDF URL:', response.url);\n  console.log('Credits remaining:', response.creditsRemaining);\n}\n\ngeneratePdf();\n```\n\n## Features\n\n- **Template-based PDF generation** - Create templates with dynamic variables, generate PDFs with your data\n- **Multiple export options** - Get a signed URL (default) or raw binary PDF\n- **S3 integration** - Upload generated PDFs directly to your own S3-compatible storage\n- **TypeScript support** - Full type definitions included\n\n## API Methods\n\n### PDF Generation\n\n```typescript\n// Generate PDF and get URL\nconst response = await api.createPdf({\n  templateId: 'TEMPLATE_ID',\n  data: { name: 'John Doe' },\n  exportType: 'url',        // 'url' or 'binary'\n  expiration: 86400,        // URL expiration in seconds (default: 24h)\n  filename: 'invoice-001',  // Custom filename\n});\n```\n\n### Templates\n\n```typescript\nimport { TemplatesApi } from '@templatefox/sdk';\n\nconst templatesApi = new TemplatesApi(config);\n\n// List all templates\nconst templates = await templatesApi.listTemplates();\n\n// Get template fields\nconst fields = await templatesApi.getTemplateFields({ templateId: 'TEMPLATE_ID' });\n```\n\n### Account\n\n```typescript\nimport { AccountApi } from '@templatefox/sdk';\n\nconst accountApi = new AccountApi(config);\n\n// Get account info\nconst account = await accountApi.getAccount();\nconsole.log('Credits:', account.credits);\n\n// List transactions\nconst transactions = await accountApi.listTransactions({ limit: 100, offset: 0 });\n```\n\n### S3 Integration\n\n```typescript\nimport { IntegrationsApi } from '@templatefox/sdk';\n\nconst integrationsApi = new IntegrationsApi(config);\n\n// Save S3 configuration\nawait integrationsApi.saveS3Config({\n  s3ConfigRequest: {\n    endpointUrl: 'https://s3.amazonaws.com',\n    accessKeyId: 'AKIAIOSFODNN7EXAMPLE',\n    secretAccessKey: 'your-secret-key',\n    bucketName: 'my-pdf-bucket',\n    defaultPrefix: 'generated/pdfs/',\n  }\n});\n\n// Test connection\nconst test = await integrationsApi.testS3Connection();\nconsole.log('Connection:', test.success ? 'OK' : 'Failed');\n```\n\n## Configuration Options\n\n```typescript\nconst config = new Configuration({\n  basePath: 'https://api.templatefox.com', // Default API URL\n  apiKey: 'your-api-key',\n});\n\n// Or use environment variable\nconst config = new Configuration({\n  apiKey: process.env.TEMPLATEFOX_API_KEY,\n});\n```\n\n## Error Handling\n\n```typescript\ntry {\n  const response = await api.createPdf({ /* ... */ });\n} catch (error) {\n  if (error.status === 402) {\n    console.error('Insufficient credits');\n  } else if (error.status === 403) {\n    console.error('Access denied - check your API key');\n  } else if (error.status === 404) {\n    console.error('Template not found');\n  } else {\n    console.error('Error:', error.message);\n  }\n}\n```\n\n## Documentation\n\n- [API Documentation](https://templatefox.com/docs)\n- [Swagger UI](https://api.templatefox.com/docs)\n- [Dashboard](https://templatefox.com/dashboard)\n\n## Support\n\n- Email: support@templatefox.com\n- Issues: [GitHub Issues](https://github.com/TemplateFoxPDF/typescriptsdk/issues)\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemplatefoxpdf%2Ftypescriptsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemplatefoxpdf%2Ftypescriptsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemplatefoxpdf%2Ftypescriptsdk/lists"}