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().
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.
<script src="https://cdn.jsdelivr.net/npm/agentprose@0/dist/agentprose.min.js" defer data-adapter="enonic" data-endpoint="https://example.com/site/myproject/master" data-content-type="com.example.myapp:article" data-site-key="/mysite"></script>Search uses the Query DSL fulltext.
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.