generatetypesfromloops
v2.0.23
Published
Generate types from your emails created in Loops
Downloads
7
Readme
Loops API Types Generator
This script generates TypeScript types based on the OpenAPI schema fetched from the Loops API. The generated types are stored in a specified output file, which can be used in a TypeScript project.
Top-level file configurations
.env
(
.env.template
)
- The
LOOPS_API_KEY
key is used to authenticate with the Loops API.
.loopsConfig.json
(
.loopsConfig.template.json
)
The configuration file should contain the following keys:
domain
(optional): The domain of the Loops API. Defaults to "app.loops.so".outputFile
(optional): The file path for the generated TypeScript types. Defaults to "generatedTypes.d.ts". Note: will overwrite an existing file.envKey
(optional): The environment variable key for the Loops API key. Defaults to "LOOPS_API_KEY".transactional
(required): An object that defines the mapping of transactional email ids to desired name of the generated type.debug
(optional): A flag to enable debug mode. Defaults to false.
Usage
Create .loopsConfig.json
and a .env
per the instructions above. Then run the following command:
npm run loops