{"id":15628417,"url":"https://github.com/charlyx/koa-izanami-proxy","last_synced_at":"2025-04-29T01:45:27.311Z","repository":{"id":139190487,"uuid":"177290477","full_name":"charlyx/koa-izanami-proxy","owner":"charlyx","description":"Izanami proxy for Koa","archived":false,"fork":false,"pushed_at":"2019-03-25T14:48:27.000Z","size":170,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T12:11:14.173Z","etag":null,"topics":["izanami","koa","node","proxy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charlyx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-23T13:11:04.000Z","updated_at":"2019-11-21T09:29:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a4d46cd-c9a3-4e14-9fb6-e4ce0913176a","html_url":"https://github.com/charlyx/koa-izanami-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlyx%2Fkoa-izanami-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlyx%2Fkoa-izanami-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlyx%2Fkoa-izanami-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlyx%2Fkoa-izanami-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlyx","download_url":"https://codeload.github.com/charlyx/koa-izanami-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251418342,"owners_count":21586387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["izanami","koa","node","proxy"],"created_at":"2024-10-03T10:22:31.229Z","updated_at":"2025-04-29T01:45:27.291Z","avatar_url":"https://github.com/charlyx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-izanami-proxy\n\n[![Build Status](https://travis-ci.org/charlyx/koa-izanami-proxy.svg?branch=master)](https://travis-ci.org/charlyx/koa-izanami-proxy)\n[![Coverage Status](https://coveralls.io/repos/github/charlyx/koa-izanami-proxy/badge.svg?branch=master)](https://coveralls.io/github/charlyx/koa-izanami-proxy?branch=master)\n\n[Izanami](https://maif.github.io/izanami/) proxy for [Koa](https://koajs.com/)\n\n## Why?\n\nIn order to use Izanami features on the client side you have to use a proxy. To call Izanami APIs you need to provide authentication keys and you don’t want the keys to be exposed on the client side. For further details, please see the [documentation](https://maif.github.io/izanami/manual/tutorials/spring.html#create-a-proxy).\n\nThe proxy provided by [izanami-node](https://github.com/MAIF/izanami/blob/8af5562f9b56d3082441e5fc052af1dccba26ecc/izanami-clients/node/readme.md) has been written for express, thus it does not work with Koa.\n\n## Install\n\n```sh\nnpm install koa-izanami-proxy@alpha\n```\n\n```sh\nyarn add koa-izanami-proxy@alpha\n```\n\n\n## Usage\n\n\nYou must specify at least one client configuration option depending on your needs (either `featureClientConfig`, `experimentClientConfig` or `configClientConfig`).  \nOne must contain a `host`, `clientId` and `clientSecret`:\n\n* `host` is your Izanami server URL\n* `clientId` and `clientSecret` are secrets you've created in Izanami keys management.\n\nOther options are available for [proxy configuration](#proxy-configuration).\n\n```js\nconst Koa = require('koa')\nconst cors = require('@koa/cors')\nconst izanamiProxy = require('koa-izanami-proxy')\n\nconst featureClientConfig =  {\n  host: 'http://localhost:8080', // Izanami server URL\n  clientId: process.env.CLIENT_ID || 'client',\n  clientSecret: process.env.CLIENT_SECRET || 'client1234',\n}\n\nconst app = new Koa()\n\napp.use(cors())\n\nconst proxyConfiguration = { app, featureClientConfig }\n\nizanamiProxy(proxyConfiguration)\n\napp.listen(5000, () =\u003e {\n  console.log('Example app listening on port 5000!')\n})\n```\n\n## Proxy configuration\n\n```js\n{\n  path: '/your/path', // default: '/api/izanami'\n  featureClientConfig, // Optional\n  configClientConfig, // Optional\n  experimentClientConfig, // Optional\n  experimentWonPath: '/your/won/path', // default: '/api/experiments/won'\n  experimentDisplayedPath: '/your/displayed/path',  // default: '/api/experiments/displayed'\n  app, // Koa app \n  pattern: 'my.namespace.*' // The pattern to filter experiments, configs and features (default: '*')\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlyx%2Fkoa-izanami-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlyx%2Fkoa-izanami-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlyx%2Fkoa-izanami-proxy/lists"}