# Config

The plugin needs to be configured with endpoints, providers, and functions.

* go to Plugins > ICP Agent > settings
* add your own config inside the configEditor field

### Example config: <a href="#example-config" id="example-config"></a>

#### Content providers <a href="#content-providers" id="content-providers"></a>

```javascript
{
    "imengine-provider": {
        "type": "imengine",
        "endpoint": "https://domain/imengine/image.php",
        "functions": {
            "default": {
                "template": "uuid=[identifier]&type=[type:preview]&function=hardcrop&width=[width]&height=[height]&q=80"
            },
            "thumbnail": {
                "template": "uuid=[identifier]&type=[type:preview]&function=thumbnail&width=[width]&height=[height]&q=80"
            },
            "crop": {
                "template": "uuid=[identifier]&type=[type:preview]&function=cropresize&width=[width]&height=[height]&x=[x:0.5]&y=[y:0.5]&crop_w=400&crop_h=300&q=80"
            }
        }
    },
    "imgix-with-signature-provider": {
        "type": "imgix",
        "endpoint": "https://domain.imgix.net",
        "token": "TOKEN-GOES-HERE-FOR_SIGNATURE-IMGIX",
        "functions": {
            "default": {
                "template": "[identifier]?w=[width]&h=[height]&s=[signature]"
            },
            "crop": {
                "template": "[identifier]?w=[width]&h=[height]&fit=crop&crop=faces&s=[signature]"
            }
        }
    },
    "writer": {
            "type": "imengine/imgix",
            "endpoint": "url-to-endpoint",
            "functions": {
                "default": {
                    "template": "uuid=[identifier]&type=[type:preview]&function=hardcrop&width=[w:auto]&q=[q:75]"
                },
                "crop": {
                    "template": "uuid=[identifier]&type=[type:preview]&function=hardcrop&width=[w]&height=[h]&q=[q:75]"
                },
                "crop-resize": {
                    "template": "uuid=[identifier]&function=cropresize&type=preview&q=75&crop_w=[cwrel]&crop_h=[chrel]&width=[w:auto]&height=[h:auto]&x=[cxrel:0]&y=[cyrel:0]&zoom=0"
                }
            }
        }
}
```

### **Functions**

Functions are a way to configure new image functions into the plugin. This can later be used by different plugins. The criteria is that each function at least contains a "default" function as a fallback.

### **Template strings**

The strings are built upon known structure for the specific service and should be the query strings of each services without the starting "?". Each parameter is build with a key=\[value] structure where value can be followed by a :optional argument. Example: key\[value:optional] where optional is a default value if non is passed to the specific function.

#### [<br>](https://app.gitbook.com/@infomaker/s/content-agent/installing)
