<!-- AANCER developer pages, part 9 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Full examples

### Theme with a font and logos, scoped to one workspace, plus a locale overlay for the installation

`manifest.json`:

```json
{
  "v": 2, "kind": "bundle", "id": "acme.workspace-ci", "version": "1.0.0", "title": "Acme workspace identity",
  "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" },
  "requires": { "platform": ">=1.0.0" },
  "parameters": [ { "id": "target_workspace", "type": "workspace", "label": "Workspace", "required": true } ],
  "items": [
    { "kind": "theme", "schemaVersion": 2, "id": "acme-ws-ci", "scope": "workspace", "workspace": "{{param.target_workspace}}",
      "spec": { "$ref": "content/theme.json" } },
    { "kind": "locale", "schemaVersion": 1, "id": "de-words", "scope": "install",
      "spec": { "locale": "de", "keys": { "nav.knowledge": "Wissen" } } }
  ]
}
```

`content/theme.json`:

```json
{
  "id": "acme-ws-ci",
  "platformName": "Acme",
  "tagline": "Your data. Your AI.",
  "defaultTheme": "light",
  "fonts": [
    { "family": "Acme Sans", "src": "content/fonts/acme-sans.woff2", "weight": "400 700", "style": "normal", "display": "swap" }
  ],
  "typography": {
    "ui": "'Acme Sans', system-ui, sans-serif",
    "display": "'Acme Sans', system-ui, sans-serif"
  },
  "themes": {
    "light": {
      "--bg": "#ffffff", "--s0": "#f3f6f7", "--s1": "#ffffff", "--s2": "#ffffff", "--s3": "#f3f6f7", "--s4": "#e6ecee",
      "--t0": "#14232a", "--t1": "#3c4f57", "--t2": "#5b6c73",
      "--ac": "#0f6e74", "--aci": "#ffffff", "--acs": "#e3f2f2", "--acb": "rgba(15,110,116,0.30)",
      "--pr": "#14232a", "--prs": "#e9eef0", "--prb": "rgba(20,35,42,0.30)",
      "--b": "#d3dcdf", "--bm": "#b8c5ca", "--bs": "#8a9aa0", "--scrollbar": "#b8c5ca",
      "--anchor": "#14232a", "--anchor-raised": "#22343c", "--ink-on-anchor": "#ffffff", "--ink-on-anchor-dim": "#c3cfd3",
      "--shadow-card": "0 1px 3px rgba(20,35,42,0.08), 0 4px 14px rgba(20,35,42,0.06)"
    },
    "dark": {
      "--bg": "#0f1a1f", "--s0": "#0a1317", "--s1": "#0f1a1f", "--s2": "#17252b", "--s3": "#1f2f36", "--s4": "#2a3c44",
      "--t0": "#eef3f4", "--t1": "#c3cfd3", "--t2": "#9fb0b6",
      "--ac": "#5cc6c9", "--aci": "#0a1317", "--acs": "#12343a", "--acb": "rgba(92,198,201,0.35)",
      "--pr": "#c3cfd3", "--prs": "#1f2f36", "--prb": "rgba(195,207,211,0.35)",
      "--b": "#2a3c44", "--bm": "#3a4f58", "--bs": "#4e646d", "--scrollbar": "#3a4f58",
      "--anchor": "#081014", "--anchor-raised": "#1f2f36", "--ink-on-anchor": "#eef3f4", "--ink-on-anchor-dim": "#9fb0b6",
      "--shadow-card": "0 1px 3px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.3)"
    }
  },
  "logos": {
    "light": "content/logos/logo.png",
    "dark": "content/logos/logo-dark.png",
    "favicon": "content/logos/mark.png"
  }
}
```

The folder also holds `content/fonts/acme-sans.woff2`, `content/logos/logo.png`, `content/logos/logo-dark.png` and `content/logos/mark.png`. `login` and `email` are left out because they apply to install-scoped themes only.

## Install and test

### In the UI

1. **Platform Settings > Extensions > Trust keys > Add trust key**, once per publisher.
2. **Import pack**. The summary lists items, fonts, logos and contrast warnings.
3. **Activate**. Pick the workspace if the theme is workspace-scoped.
4. Reload the browser.

Under **Platform Settings > Look & feel**, an administrator can switch between stock and imported themes, and offer themes for users to choose. Retiring the pack returns to the stock look, or to the manual branding if one was set.

### With the REST API

| Call | Permission |
|---|---|
| `POST /api/extensions/packs/import` (raw bytes) | `extensions.manage` |
| `POST /api/extensions/packs/{packId}/activate {version, parameters}` | `extensions.manage` (`extensions.manage_own` for workspace-only packs) |
| `GET /api/extensions/themes` | lists stock and imported themes |
| `POST /api/extensions/themes/apply {packId or null, version?}` | switch the active theme |
| `PUT /api/extensions/themes/{packId}/offer {offered: true}` | let users choose it |
| `PUT /api/appearance/me {packId or null}` | a user picks an offered theme (`appearance.choose`) |
| `GET /api/branding` | public, the active branding |
| `GET`, `PUT /api/admin/branding` | manual branding without a pack (`platform.configure_branding`) |

While an install-scoped theme pack is active, manual branding is read-only.

Test in an EVAL or test installation first: import shows every contrast warning before anything changes.

## Common errors

| Message | Fix |
|---|---|
| external or inline resources are not allowed (no http, //, data:, url() anywhere) (`THEME_EXTERNAL_ASSET`) | Ship files in `content/`. Remove URLs and `//` from every text, including tagline and footer |
| `/themes/<id>`: unknown theme id | Use one of the seven block ids |
| `/themes/<id>/<token>`: not a themable token | Use a token from the table. Fonts go in `typography` |
| colour must be #rgb, #rrggbb or rgba(r,g,b,a) | No `var()`, `hsl()` or names |
| `/typography/<k>`: font family '...' is not declared in fonts[] and is not a generic family | Declare the font in `fonts` |
| must be a pack file under content/fonts or content/logos | Fix the path. Lower-case file names only |
| fonts must live under content/fonts/ / logos must live under content/logos/ | Move the file |
| `<path>` is not in the pack (`PACK_SIGNATURE_INVALID`) | Add the file and sign again |
| `<path>` is not a woff2 font (`THEME_ASSET_MIME`) | Convert the font to woff2 |
| `<path>`: contains `<script>` / an event handler attribute / references an external resource (`THEME_ASSET_MIME`) | Clean the SVG |
| `<path>` exceeds ... bytes (`THEME_ASSET_TOO_LARGE`) | Fonts and logos at most 2 MiB each |
| `<a>` on `<b>` is illegible (`THEME_ILLEGIBLE`) | Pick colours with more contrast |
| warning `CONTRAST_AA: light --aci on --ac = 3.05:1 (needs 4.5:1)` | Optional, but fix it for readability |
| `THEME_ALREADY_ACTIVE`: Theme pack '...' is already active; retire it first | Retire the other theme, or switch under Look & feel |
| locale: key is not in the shipped bundle (`LOCALE_KEY_UNKNOWN`) | Use an existing UI key |
| locale: markup is not allowed / interpolation slots must match the shipped text | No `<` or `>`; keep the same `{{slots}}` |
| `LOCALE_ALREADY_ACTIVE` | One overlay per locale for the installation |
| locale: vendor names are not allowed in UI copy (`LOCALE_VENDOR_STRING`) | Remove the product name from the text |
| locale: `_meta` keys are not overridable | Remove the key |

## Limits and editions

- Fonts and logos: at most 2 MiB each, 12 fonts per theme. Pack limits apply (see [Packs](/developers/packs)).
- `login` and `email` apply to install-scoped themes only.
- Theme packs are controlled by permissions: `extensions.manage`, `platform.configure_branding`, `appearance.choose`.
- A theme pack changes colours, fonts, logos and names. Removing the "powered by AANCER" attribution is a separate licence feature.
- Check your edition on [aancer.ai/pricing](https://aancer.ai/pricing).


---

Source: https://aancer.ai/developers-connectors

---
title: Connectors | AANCER Developers
description: Build an AANCER connector: the TypeScript connector, pack.json, the connector item spec, network egress rules, and certification by AANCER.
---

## Connectors

A connector is an integration with one external system: a set of actions and triggers that workflows, agents, chat tools and knowledge sources call. AANCER offers 750+ connectors. Most of them come from the connector library that ships with each release, and an administrator installs them from the catalog with one click and no restart.

You can build your own connector for a system that is not covered, such as an in-house ERP or a regional service. A connector is written in TypeScript with the AANCER connector framework (`@aancer/connector-framework`). The framework comes with the developer kit, with full TypeScript declarations (node10 and node16 module resolution) and a scaffold. A connector written against it builds against the runner's own copy of the framework during certification, so the pack ships without a bundled copy. A connector reaches an installation as a signed **connector pack**: a pack with exactly one `connector` item, which `aancer-pack` builds from your code.

Connector code runs inside AANCER, so the rules are stricter than for other packs. **Connector packs for production are signed by AANCER through certification.** Partners build and test the connector, then submit it. AANCER reviews it, builds the archive and signs the pack. On every edition except the developer edition, a connector pack signed with any other key is refused.

**On the developer edition you sign your own connectors.** Sign the pack with your developer key and it installs on your installation only: the pack is bound to that installation's install id, and both the gateway and the connector runner check it. Remove the key and the connector stops. To ship the connector to customers, submit it for certification.

Outbound network access is denied by default. A connector can reach only the hosts it declares, and only after an administrator clicks **Enable**.

## Quick start

Start from the scaffold, `aancer-pack init connector <name>`, or write it by hand. A connector with one action that echoes its input.

`package.json`:

```json
{
  "name": "@aancer/piece-example-echo",
  "version": "0.1.0",
  "main": "./dist/src/index.js",
  "dependencies": {
    "@aancer/connector-framework": "^0.33"
  }
}
```

`src/index.ts`:

```ts
import { createConnector, createAction, Property, ConnectorAuth } from '@aancer/connector-framework';

const echo = createAction({
  name: 'echo',
  displayName: 'Echo',
  description: 'Returns the text you send.',
  props: {
    text: Property.ShortText({ displayName: 'Text', required: true }),
  },
  async run({ propsValue }) {
    return { text: propsValue.text };
  },
});

export const connector = createConnector({
  displayName: 'Example echo',
  auth: ConnectorAuth.None(),
  minimumSupportedRelease: '0.82.0',
  logoUrl: 'https://cdn.example.com/echo.png',
  authors: ['acme'],
  actions: [echo],
  triggers: [],
});
```

`pack.json`:

```json
{
  "displayName": "Example echo",
  "description": "Echoes its input back. Useful to test connector install.",
  "category": "Developer",
  "egressHosts": []
}
```

Submit these files for certification. The result is a signed connector pack that any AANCER installation accepts.

## File layout

What you write:

```text
example-echo/
  package.json         # name @aancer/piece-<name>, version x.y.z, main ./dist/src/index.js
  package-lock.json    # locked runtime dependencies
  pack.json            # pack metadata, see below
  tsconfig.json
  src/
    index.ts           # createConnector(...) export
    lib/*.ts           # actions and triggers
  test/*.ts
```

What the certified pack contains:

```text
conn.example-echo-0.1.0.ancpack
  MANIFEST.json        # pack manifest with one connector item
  MANIFEST.sig         # AANCER platform signature
  content/<archive>    # the built connector, written by the build
```

Next part: https://aancer.ai/dev/parts/pages/10-field-reference.md
