Deploy your Cobalt agent to SharePoint Online
Put a Cobalt agent on your SharePoint Online (modern) intranet so people get help on the pages they already use. The agent runs in the top-level page (not an iframe), so it behaves exactly like the Cobalt web widget on any other site.SharePoint Online (modern) only. SharePoint on-premises and classic pages
are not supported. You always need a SharePoint tenant admin (App Catalog
- Script sources). Single sign-on additionally needs a Microsoft Entra admin (to consent to Cobalt’s app — once per tenant). Plan ~20 minutes for the anonymous path, ~40 for SSO.
Choose how users are identified
Pick this on the channel before you deploy; you can change it later.
If you just want a working agent on SharePoint, use Anonymous — it’s the
fastest path and supports the entire composer (attachments, dictation, voice).
Add SSO later when you want conversations attributed to the signed-in employee.
How it works
Cobalt ships a small SharePoint Framework (SPFx) package. Its web part setswindow.cobaltSettings and injects Cobalt’s widget loader (loader.js) from the
Cobalt widget host, in the top-level page. For SSO it also silently acquires
the signed-in user’s Microsoft Entra token and forwards it; Cobalt verifies that
token against your tenant’s identity provider and binds the conversation to the
employee.
One package, no per-customer build. The SSO token is requested for Cobalt’s
own multi-tenant Entra application — the same app for every customer. The
package holds no secret; you never register your own app or rebuild the
.sppkg. You consent to Cobalt’s app once, and configure Cobalt to trust tokens
from your tenant.
The production Cobalt widget host is
https://widget.cobalt.peoplereign.io.
Use it everywhere below, including the Trusted Script Source. One caveat: the
current package (v1.0.2) still defaults its Widget source URL to Cobalt’s
dev host, so set that property explicitly to
https://widget.cobalt.peoplereign.io/loader.js when you configure the web
part or extension (called out again in the steps below). A package update will
flip the default.Prerequisites & roles
- A Cobalt web-widget channel (create or reuse one).
- SharePoint tenant admin — to upload + deploy the package in the App Catalog and add the widget host as a Trusted Script Source.
- Microsoft Entra admin — SSO only: to admin-consent Cobalt’s application in your tenant (once).
- Owner/Admin in the Cobalt console — channel + token-verification config is admin-only.
1. Configure the channel in Cobalt
In the Cobalt console, open the web-widget channel and set these before you deploy:- Identity mode — Anonymous or Federated SSO, per the table above.
- Allowed origins — add your SharePoint origin:
https://<tenant>.sharepoint.com(or the wildcardhttps://*.sharepoint.com, which also covers the-my/ OneDrive host). Required — Cobalt refuses the widget’s config fetch and chat connection from any origin you haven’t listed (you’ll otherwise see a403). A bare*is not accepted. - Copy the Channel Key from the Install tab — you’ll paste it into the web part in Step 5.
2. Download the package from the Install tab
In the channel’s Install tab, set Deploy to → SharePoint site, then download the versioned package (currentlycobalt-agent-widget-1.0.2.sppkg). The
Install tab is the only place the package is distributed.
3. Upload + deploy to the App Catalog
- Go to your tenant App Catalog:
https://<tenant>.sharepoint.com/sites/appcatalog. - Open Apps for SharePoint and upload the
.sppkg. - In the trust dialog, review and click Deploy.
- Leave Make this solution available to all sites in the organization
checked (the package uses
skipFeatureDeployment) so the web part and site-wide launcher are available tenant-wide without per-site installs.
4. Add the widget host as a Trusted Script Source
This is the step people miss. SharePoint Online enforces a modern-page Content Security Policy. The widget’sloader.js is an external script, so
SharePoint blocks it under script-src unless a tenant admin adds the widget
host as a Trusted Script Source — once per tenant.
- Admin center
- PowerShell
- Open the SharePoint admin center.
- Go to Advanced → Script sources.
- Add source →
https://widget.cobalt.peoplereign.io→ Save. - Effective within a few minutes — hard-refresh the page afterward.
5. Add the agent to a page
Both surfaces ship in the same package.- Web part (per-page)
- Application Customizer (site-wide)
- Edit a page → + → add the “Cobalt Agent” web part.
- In the property pane, paste the Channel Key (from the Install tab) and
set Widget source URL to
https://widget.cobalt.peoplereign.io/loader.js(the v1.0.2 package pre-fills Cobalt’s dev host — see the note above). Leave Token resource at its default — it’s pre-filled for Cobalt’s Entra app. - Publish the page.
6. (SSO only) Consent to Cobalt’s app + configure verification
A federated-identity channel needs two one-time actions: consent to Cobalt’s Entra application in your tenant, and tell Cobalt to trust tokens from your tenant. You do not register your own app or change the package.6a. Admin-consent Cobalt’s application (once per tenant)
A Microsoft Entra Global Admin grants tenant-wide consent to Cobalt’s multi-tenant app (client id956f530e-a3a7-41b7-b4c3-0baf77760c2b). This
provisions the app’s service principal in your tenant so SharePoint can silently
obtain a token for it.
- PowerShell (recommended)
- Admin consent URL
Order matters: the app’s service principal must exist in your tenant (the
consent /
New-MgServicePrincipal step) before the SharePoint API-access
request will resolve. If API access shows “The requested permission isn’t
valid”, the app hasn’t been provisioned yet — do 6a first, then re-check. The
PowerShell grant above performs the same authorization the API-access page
would, and sidesteps it entirely.6b. Configure token verification in Cobalt
In the Cobalt console: Settings → SSO → End-user token verification → Federated identity (federated_oidc):
Set the email claim to
preferred_username, not email. Cobalt reads the
single claim you name here — there is no fallback to other claims. By
default an Entra v2.0 access token (which is what SharePoint issues for
Cobalt’s app) carries the user’s UPN in preferred_username and does
not include an email claim, so naming email makes every verified token
fail with “user isn’t recognized”. preferred_username is the UPN
(e.g. jane@contoso.com) and is present by default. (If you specifically need
the mailbox address instead of the UPN, add email as an
optional claim
on Cobalt’s app registration and only then set this field to email.)7. Verify it works
Open a SharePoint page and confirm:- The launcher loads, and a test message round-trips.
- (SSO) No sign-in prompt, popup, or redirect; the agent recognizes you.
aud must be in your Allowed audiences and iss must match your Issuer.
