Skip to content

Document server-side content resolver #1256

Description

@cassidyjames

We've talked about this a couple of times but I didn't see an issue to track it. Oops!

#1189 added a server-side content resolver to handle the case when review jobs outlive media URLs, but we don't currently document it. We should fix this! At a glance, I think it makes sense to add to the deployment guide, similar to the content proxy section:

## Content Proxy
Coop can optionally route item content URLs through a **content proxy**: a service you host that fetches a content URL and serves it back inside the review iframe, so it can control presentation and apply wellness features (since the review UI cannot otherwise style or control content from a cross-origin iframe).
Set `VITE_CONTENT_PROXY_URL` to your proxy's base URL to enable it. Left unset (the default), matching content just loads directly in the iframe.
Coop does not ship a reference proxy implementation, so you'll need to deploy your own implementation.
### Load content
Coop loads your proxy at:
```
<VITE_CONTENT_PROXY_URL>/?contentUrl=<url-encoded content URL>
```
Your service should fetch and serve back the given `contentUrl`'s content.
### Wellness features
After the iframe loads, and whenever a reviewer changes their overlay settings, Coop posts a message to your proxy's page:
```json
{
"type": "customControl",
"blur": 0,
"grayscale": false,
"shouldTranslate": false,
"sepia": false
}
```
`blur` ranges from `0` (none) to `6` (strongest); `grayscale` and `sepia` are simple on/off filters. Your proxy's page should listen for this message and apply the requested effects to the content it's displaying.

Something that wasn't clear to me from looking over #1189 was how to actually deploy a content resolver and tell Coop about it; we'll want to make sure that's clear so we document the best practice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationAffects documentation, including improvements or additionsneeds infoFurther information is requested

Type

Fields

Priority

None yet

Projects

  • Status
    Todo
  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions