This Astro integration project provides a createAstroRoute
function that can be used to create an API endpoint route in your Astro project for integration with the hosted Trigger.dev platform.
- Install the package:
npm install --save https://github.com/lirantal/triggerdev-astro-integration
Note: yes, right now this package isn't published to the npm registry, so you'll need to install it from my GitHub repository if you want to experiment with it. Hopefully this soon graduates into an official npm package from the Trigger.dev team 🙏🏼
- Import the package in a
src/pages/api/trigger.js
file and define the route endpoint as follows:
import { createAstroRoute } from "triggerdev-astro-integration";
import { client } from "../../../trigger.js";
export const post = createAstroRoute(client);
See the Trigger.dev Astro example project repository for a working example of this integration.
MIT
(c) Liran Tal [email protected]