Mirror of https://github.com/roostorg/coop-integration-example github.com/roostorg/coop-integration-example
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Julietshen/update styling (#3)

* update styling of Coop and replace logo

* resize new logo

* update version to 2.0.1

* upgrade package lock

---------

Co-authored-by: Juan S. Mrad <juansmrad@gmail.com>

authored by

juliet
Juan S. Mrad
and committed by
GitHub
edb9fdd4 56c9c6b9

+15 -15
+7 -7
README.md
··· 1 1 # @roostorg/coop-integration-example 2 2 3 - Example [COOP](https://github.com/roostorg/coop) integration plugin. Reference repository showing how to build a custom integration and signals for use in COOP. 3 + Example [Coop](https://github.com/roostorg/coop) integration plugin. Reference repository showing how to build a custom integration and signals for use in Coop. 4 4 5 5 - **Integration config** – saving and loading per-org config (e.g. “True percentage”) 6 6 - **Routing rules** – using the plugin signal in conditions ··· 29 29 npm install @roostorg/coop-integration-example 30 30 ``` 31 31 32 - ## Configure in COOP 32 + ## Configure in Coop 33 33 34 - In your COOP `integrations.config.json` (or `INTEGRATIONS_CONFIG_PATH`), add: 34 + In your Coop `integrations.config.json` (or `INTEGRATIONS_CONFIG_PATH`), add: 35 35 36 36 **Local path (development):** 37 - If you cloned this repo next to your COOP server directory, use a path relative to the server (e.g. from `server/`): 37 + If you cloned this repo next to your Coop server directory, use a path relative to the server (e.g. from `server/`): 38 38 39 39 ```json 40 40 { ··· 54 54 } 55 55 ``` 56 56 57 - Restart the COOP server so it loads the plugin. 57 + Restart the Coop server so it loads the plugin. 58 58 59 59 ## Use in the app 60 60 61 - 1. **Org settings → Integrations** – you should see “COOP Integration Example”. Open it and set **True percentage (0–100)** (e.g. `70`) for Random Signal Selection. Save. 61 + 1. **Org settings → Integrations** – you should see Coop Integration Example”. Open it and set **True percentage (0–100)** (e.g. `70`) for Random Signal Selection. Save. 62 62 2. **Rules (routing or enforcement)** – when adding a condition: 63 63 - **Random Signal Selection**: Pick that signal; the condition uses your configured percentage (true/false). 64 64 - **Random Score**: Pick “Random Score”, then set a **threshold** on the 0–100 scale (e.g. `50`) and choose **above** or **below**. The rule compares the random score to your threshold. 65 65 66 66 ## Contract 67 67 68 - This package implements the COOP plugin contract from `@roostorg/types`: 68 + This package implements the Coop plugin contract from `@roostorg/types`: 69 69 70 70 - **Default export:** `CoopIntegrationPlugin` with `manifest` and `createSignals(context)`. 71 71 - **Manifest:** `id`, `name`, `version`, `requiresConfig`, `configurationFields`, `signalTypeIds`, `modelCard` (must include every section id in `REQUIRED_MODEL_CARD_SECTION_IDS` from `@roostorg/types`; call `assertModelCardHasRequiredSections(modelCard)` when registering).
+2 -2
package-lock.json
··· 1 1 { 2 2 "name": "@roostorg/coop-integration-example", 3 - "version": "2.0.0", 3 + "version": "2.0.1", 4 4 "lockfileVersion": 3, 5 5 "requires": true, 6 6 "packages": { 7 7 "": { 8 8 "name": "@roostorg/coop-integration-example", 9 - "version": "2.0.0", 9 + "version": "2.0.1", 10 10 "license": "Apache-2.0", 11 11 "devDependencies": { 12 12 "@roostorg/types": "^2.0.0",
+1 -1
package.json
··· 1 1 { 2 2 "name": "@roostorg/coop-integration-example", 3 - "version": "2.0.0", 3 + "version": "2.0.1", 4 4 "description": "Example package to show how a custom integration and signal can be used in COOP this is meant to be a reference repository and provide basic determination", 5 5 "type": "module", 6 6 "main": "dist/index.js",
roost-example-logo.png

This is a binary file and will not be displayed.

+5 -5
src/index.ts
··· 1 1 /** 2 - * Example COOP integration plugin with two signal types: 2 + * Example Coop integration plugin with two signal types: 3 3 * 1. Random Signal Selection – boolean, probability from org config (tests config saving). 4 4 * 2. Random Score – numeric 0–100, threshold set in the rule (tests score vs threshold). 5 5 */ ··· 19 19 const DEFAULT_TRUE_PERCENTAGE = 50; 20 20 21 21 const modelCard: ModelCard = { 22 - modelName: 'COOP Integration Example', 23 - version: '2.0.0', 22 + modelName: 'Coop Integration Example', 23 + version: '2.0.1', 24 24 releaseDate: 'March 2026', 25 25 sections: [ 26 26 { ··· 119 119 120 120 const manifest: IntegrationManifest = { 121 121 id: INTEGRATION_ID, 122 - name: 'COOP Integration Example', 122 + name: 'Coop Integration Example', 123 123 /** Same semver as modelCard.version: this plugin’s release, not @roostorg/types. */ 124 - version: '2.0.0', 124 + version: '2.0.1', 125 125 description: 126 126 'Example plugin with two signals: config-driven boolean and a numeric score you compare with a threshold in the rule.', 127 127 docsUrl: 'https://roostorg.github.io/coop/INTEGRATIONS_PLUGIN.html',