Apigee Feature Templater is your new best friend for API authoring. Forget repetitive boilerplate—Feature 🧩 and Template 🏗️ definitions let you compose APIs like a pro. Deploy them as Apigee proxies 📦 and go grab a coffee ☕.
npm i apigee-templater -gThink of this as a Lego brick for your API logic. Policies, resources, parameters—all wrapped up nicely.
Example my-feature.yaml:
name: response-hello-world
type: feature
description: Adds a hello world message to the response.
parameters:
- name: MESSAGE
default: Hello world!
policies:
- name: JS-AddMessage
type: Javascript
content:
javascript:
resourceUrl: jsc://add-message.js
resources:
- name: add-message.js
type: jsc
content: |
context.setVariable("response.content", "Hello world!");The blueprint. Mix and match features to build your dream API.
Example my-template.yaml:
name: AI-Gateway-v1
type: template
description: API template for AI-Gateway-v1
features:
- target-llm-gemini
- auth-key-header
parameters:
- name: auth-key-header.API_KEY_HEADER_NAME
default: x-api-key
endpoints:
- name: default
basePath: /v1/gemini
routes:
- name: default
target: llm-gemini
targets:
- name: llm-gemini
url: https://aiplatform.googleapis.com/v1/projects/{organization.name}/locations/global/endpoints/openapi/chat/completions
auth: GoogleAccessTokenThe final package. Ready to ship to Apigee. It is also the format used internally when a Template is processed.
Example my-proxy.yaml:
name: SimpleProxy-v1
type: proxy
description: A simple proxy definition.
endpoints:
- name: default
basePath: /v1/simple
routes:
- name: default
target: default
targets:
- name: default
url: https://mocktarget.apigee.net-
Conjure a new template: 🪄
aft my-template.yaml
-
Enchant a template with a feature: ✨
aft my-template.yaml -a target-httpbin
-
Launch (Deploy) to Apigee: 🚀
PROJECT_ID=my-gcp-project aft -i my-template.yaml -o $PROJECT_ID:my-proxy-name
Apache 2.0 - Not an official Google product (but still awesome).
