Headless CMS
When your posts live in a headless CMS, an adapter lets agents search and read them straight from the CMS’s delivery API. Pick yours, replace the placeholders, and paste the tag into your site’s layout.
Public dataset; add your site’s origin to the project’s CORS origins, without credentials.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="sanity" data-project="abc123" data-dataset="production" data-type="post" data-url-pattern="/blog/{slug}/"></script>Search uses GROQ match with score(). The Sanity page covers the schema mapping and the Studio plugin that previews what agents read.
Content Delivery API token only.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="contentful" data-space="xxxx" data-token="CDA_TOKEN" data-content-type="blogPost" data-url-pattern="/blog/{slug}/"></script>Search uses the CDA query= parameter.
A public Guillotine endpoint: on XP 8 the API mounted on the site (<site URL>/_/com.enonic.app.guillotine:graphql; here the site is served at the domain root). On XP 8, the agentprose app does all of this from one site setting.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="enonic" data-endpoint="https://example.com/_/com.enonic.app.guillotine:graphql" data-content-type="com.example.myapp:article" data-site-key="/mysite"></script>Search uses the Query DSL fulltext. Guillotine 8 and 9 (XP 8) need agentprose 0.1.4 or later; the XP 7 endpoint shape (…/site/myproject/master) still works.
Strapi 5 or 4, with the Public role allowed find and findOne on the collection. No token.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="strapi" data-api="https://cms.example.com" data-collection="articles" data-url-pattern="/blog/{slug}/"></script>The public access token.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="storyblok" data-token="PUBLIC_TOKEN" data-starts-with="blog/"></script>data-url-pattern tells agentprose where each entry lives on your site, so agents get links to your pages, not to the CMS.
Field mapping with npm
Section titled “Field mapping with npm”When your content model uses other field names, map them with the npm API:
import { createAgentTools } from 'agentprose';import { contentful } from 'agentprose/adapters/contentful';
createAgentTools({ adapter: contentful({ space: 'xxxx', accessToken: 'CDA_TOKEN', contentType: 'article', fields: { body: 'content', published: 'date', author: 'writer' }, }),});Every adapter’s options are in the adapter reference.