What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
Marketplace Apps
Use private images, videos and documents from SharePoint in Agility content, for intranets and members sections. Files stay in SharePoint, and people only see files they already have access to.
SharePoint Assets lets editors add images, videos and documents from SharePoint to Agility content and rich text. The files stay in SharePoint and aren't copied into Agility's media library. Agility stores a reference to each file, so when someone updates it in SharePoint, your site shows the latest version.
Files in Agility's media library are public. Anyone with the URL can load them from the CDN. Use SharePoint Assets when files need to stay private and they're already in SharePoint, for example on an intranet or in a members section of your website where people sign in with Microsoft. Only people who can open a file in SharePoint can see it on your site. For private files stored outside SharePoint, use Secure Files - Azure or Secure Files - AWS.
You need:
| Setting | What it does |
|---|---|
| Microsoft Entra tenant ID | Leave it empty and editors sign in with any Microsoft work account, seeing only their own organization's SharePoint. Set it and only that tenant's accounts can sign in |
| Default SharePoint site | A site pinned at the top of the picker's landing page |
| Allowed file types for SharePoint File | A list such as pdf,docx,xlsx,pptx. Applies to the SharePoint File field and the link action. Empty allows any type |
| Entra application (client) ID (Advanced) | Only if your IT team registered its own Entra app instead of approving Agility's |
You can test sign-in from the install screen. If you are a Microsoft admin, you can approve the app for your organization there too.
The rich text actions run inside the editor with the editing user's access. Agility shows this notice when any app with rich text actions is installed.
Editors can't sign in until a Microsoft admin approves the app for your organization. You only do this once per tenant, and it's done in Microsoft, not in Agility. Get it done before you add the fields for editors.
Send your Microsoft admin this link: https://sharepoint-assets.agilitycms.com/setup
The page explains what they're approving and sends them to Microsoft to accept. Here's what it grants, so they can check it against your policies:
Files.Read.All and Sites.Read.All. "Delegated" means the app acts only as the signed-in editor, so each editor sees only what they can already open in SharePoint.If an editor tries to sign in before approval, the app tells them so and gives them the /setup link to send to their admin.
Approve from the /setup page or the install screen's admin button. Don't rely on the "Consent on behalf of your organization" checkbox Microsoft shows when an admin simply signs in: it's easy to miss, and then only that admin is approved.
Add any of these custom fields to a content or component model:
| Field | Picks | Editors see | Editors set |
|---|---|---|---|
| SharePoint Image | images | the image and its dimensions | Alt text (required) |
| SharePoint Video | videos | a poster that plays in place, and the duration | Title |
| SharePoint File | any file type (or the allowed types) | the first-page thumbnail for Office files and PDFs, else the file-type icon; size and modified date | Link text |
An empty field shows Browse SharePoint. A filled field looks like Agility's own attachment fields: Browse and Remove beside the file name, Replace and Remove when you hover the preview, and an Open in SharePoint link on the file name, which works only for editors who can open the file. If a file has been deleted or the editor can't open it, the field says so.

When an editor isn't signed in to SharePoint, the field keeps the saved file and asks them to sign in before it shows the preview:

Once the app is installed, a SharePoint group appears in the rich text toolbar:
| Action | What it inserts |
|---|---|
| Link a SharePoint file | An ordinary link. The selected text stays the link text |
| Insert a SharePoint image | An image, after you add alt text |
| Insert a SharePoint video | A video, after you add a title |
| Insert a SharePoint file | A file card with a thumbnail, name and size |
In the editor, images, videos and file cards draw as a card with a preview, a SharePoint badge, and Edit (change the alt text, title or link text, or choose a different file) and Remove buttons.

Agility stores ids, never SharePoint addresses. A field's value is JSON like this:
{
"source": "sharepoint",
"kind": "image",
"siteId": "contoso.sharepoint.com,<guid>,<guid>",
"driveId": "b!…",
"itemId": "01ABC…",
"name": "site-visit.jpg",
"mimeType": "image/jpeg",
"size": 482113,
"lastModified": "2026-11-03T15:02:11Z",
"eTag": "\"{…},3\"",
"width": 1920,
"height": 1080,
"durationMs": null,
"alt": "Crew walking the site at sunrise",
"title": null,
"linkText": null
}
Why ids:
The rich text actions produce:
<a href="/api/sharepoint/{driveId}/{itemId}" data-sharepoint-drive-id="…" data-sharepoint-item-id="…"
data-sharepoint-kind="file" title="Safety plan.pdf">Safety plan</a>
<sharepoint-image data-agility-value='{"source":"sharepoint","kind":"image","driveId":"…","itemId":"…","alt":"…"}'></sharepoint-image>
<sharepoint-video data-agility-value='{"source":"sharepoint","kind":"video","driveId":"…","itemId":"…","title":"…"}'></sharepoint-video>
<sharepoint-file data-agility-value='{"source":"sharepoint","kind":"file","driveId":"…","itemId":"…","linkText":"…"}'></sharepoint-file>
Your site needs a small amount of code to show SharePoint files. It turns each stored reference into the file using the visitor's own Microsoft sign-in, so someone who can't open a file in SharePoint can't get it from your site either.
For example, in Next.js with Auth.js and the Microsoft Entra ID provider, ask for the delegated Files.Read.All scope. You can use your own Entra app registration for the site.
GET /api/sharepoint/{driveId}/{itemId} → 302 to the file's short-lived download URL (supports byte ranges, so video can seek)
GET /api/sharepoint/{driveId}/{itemId}/thumbnail → 302 to a thumbnail (?size=small | medium | large)
GET /api/sharepoint/{driveId}/{itemId}?open → 302 to the file in SharePoint
401.GET /drives/{driveId}/items/{itemId} for the download URL (@microsoft.graph.downloadUrl) or webUrl, and GET /drives/{driveId}/items/{itemId}/thumbnails for thumbnails.// app/api/sharepoint/[driveId]/[itemId]/route.ts (Next.js App Router, sketch)
import { auth } from "@/auth"
export async function GET(req: Request, { params }: { params: Promise<{ driveId: string; itemId: string }> }) {
const session = await auth()
if (!session?.accessToken) return new Response("Sign in required", { status: 401 })
const { driveId, itemId } = await params
const res = await fetch(
`https://graph.microsoft.com/v1.0/drives/${encodeURIComponent(driveId)}/items/${encodeURIComponent(itemId)}?$select=webUrl,@microsoft.graph.downloadUrl`,
{ headers: { Authorization: `Bearer ${session.accessToken}` }, cache: "no-store" }
)
if (res.status === 403 || res.status === 404) return new Response("Not found", { status: 404 })
if (!res.ok) return new Response("SharePoint error", { status: 502 })
const item = await res.json()
const open = new URL(req.url).searchParams.has("open")
return Response.redirect(open ? item.webUrl : item["@microsoft.graph.downloadUrl"], 302)
}
<img src="/api/sharepoint/{driveId}/{itemId}/thumbnail?size=large" alt="{alt}">, or next/image with a custom loader pointed at the thumbnail route.<video src="/api/sharepoint/{driveId}/{itemId}" controls title="{title}">.?open (open in SharePoint).href already points at your route. The three elements need a renderer: parse the rich text, read data-agility-value, and replace each <sharepoint-image>, <sharepoint-video> and <sharepoint-file> with the markup above. Without a renderer they show nothing, so a site that skips this step loses the media rather than exposing it..avi, .wmv and most .mkv). The editor shows a poster and a note to open the file in SharePoint. Convert those to .mp4 for your site.| What you see | What to do |
|---|---|
| Editors are told the app needs approval | A Microsoft admin hasn't approved it yet. Send them https://sharepoint-assets.agilitycms.com/setup |
| The sign-in window opens and closes, or nothing happens | Allow pop-ups for the Agility Content Manager, then try again |
| A field says the file wasn't found or you don't have access | The file was deleted, or you can't open it in SharePoint. Ask its owner, or choose another file |
| Images and videos show on your site in preview but not live (or the reverse) | Check that the live site signs visitors in and that your /api/sharepoint route is deployed there |