https://github.com/triggerdotdev/mergent
The API Hero integration for Mergent.co
https://github.com/triggerdotdev/mergent
Last synced: 5 months ago
JSON representation
The API Hero integration for Mergent.co
- Host: GitHub
- URL: https://github.com/triggerdotdev/mergent
- Owner: triggerdotdev
- License: other
- Created: 2022-10-14T13:35:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-14T14:08:01.000Z (about 3 years ago)
- Last Synced: 2025-03-02T00:08:39.350Z (10 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API Hero integration for Mergent.co
## Installation
```bash
npm i @apihero/node @apihero/mergent
```
## Usage
### Create a task
```ts
import { fetchEndpoint } from "@apihero/node"
import { endpoints, Task } from "@apihero/mergent"
async function main(): Promise {
const result = await fetchEndpoint(endpoints.createTask, {
task: {
name: "Example task",
delay: "PT1M",
scheduled_for: "2021-10-01T15:53:05Z"
request: {
url: "https://app.apihero.run/mergent/callbacks/1234",
headers: {
'Content-Type': "application/json"
},
body: JSON.stringify({ foo: "bar" })
}
}
});
if (result.status === "error") {
throw result.error;
}
return result.data;
}
```