@thg-altitude/astro-integration
v1.7.2-alpha.16
Published
Astro integration for altitude applications
Downloads
5,219
Readme
astro-integration
Integrations for Altitude storefronts using Astro
Single Tenancy
Inside of the astro.config.mjs file, import the integration function and invoke this inside of defineConfig with your site config object
import { altitudeMiddleware, env } from "@thg-altitude/astro-integration";
export default defineConfig({
integrations: [
altitudeMiddleware({
site: "www.yoursite.com",
commerce: {
endpoint: "",
},
blog: {
secret: env("YOURSITE_ENV_REFERENCE"),
},
}),
],
});
Multi Tenancy
Define each of the site configs in their own respective file
// /config/siteone.js
import { env } from "@thg-altitude/astro-integration";
export default {
site: "www.siteone.com",
commerce: {
endpoint: "",
},
blog: {
secret: env("SITEONE_ENV_REFERENCE"),
},
};
Export the config files from a single file as an array containing each config object
// /config/index.js
import siteone from "./siteone";
import sitetwo from "./sitetwo";
export default [siteone, sitetwo];
Inside of the astro.config.mjs file, import the integration function and invoke this inside of defineConfig with your sites configs array.
import { altitudeMiddleware, env } from "@thg-altitude/astro-integration";
import siteConfigs from "./config";
export default defineConfig({
integrations: [altitudeMiddleware(siteConfigs)],
});