{"id":18729893,"url":"https://github.com/openflagr/jsflagr","last_synced_at":"2025-08-31T14:09:59.847Z","repository":{"id":71790823,"uuid":"393568955","full_name":"openflagr/jsflagr","owner":"openflagr","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-07T03:39:03.000Z","size":208,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-02T05:03:16.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openflagr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-08-07T03:38:37.000Z","updated_at":"2024-07-07T22:22:57.000Z","dependencies_parsed_at":"2023-06-10T12:30:36.325Z","dependency_job_id":null,"html_url":"https://github.com/openflagr/jsflagr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openflagr/jsflagr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openflagr%2Fjsflagr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openflagr%2Fjsflagr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openflagr%2Fjsflagr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openflagr%2Fjsflagr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openflagr","download_url":"https://codeload.github.com/openflagr/jsflagr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openflagr%2Fjsflagr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988919,"owners_count":25026961,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T14:29:34.995Z","updated_at":"2025-08-31T14:09:59.826Z","avatar_url":"https://github.com/openflagr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsflagr\n\nJsflagr - JavaScript client for jsflagr\nFlagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \\\"/api/v1\\\". \nThis SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:\n\n- API version: 1.1.10\n- Package version: 1.1.10\n- Build package: io.swagger.codegen.languages.JavascriptClientCodegen\n\n## Installation\n\n### For [Node.js](https://nodejs.org/)\n\n#### npm\n\nTo publish the library as a [npm](https://www.npmjs.com/),\nplease follow the procedure in [\"Publishing npm packages\"](https://docs.npmjs.com/getting-started/publishing-npm-packages).\n\nThen install it via:\n\n```shell\nnpm install jsflagr --save\n```\n\n##### Local development\n\nTo use the library locally without publishing to a remote npm registry, first install the dependencies by changing \ninto the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:\n\n```shell\nnpm install\n```\n\nNext, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:\n\n```shell\nnpm link\n```\n\nFinally, switch to the directory you want to use your jsflagr from, and run:\n\n```shell\nnpm link /path/to/\u003cJAVASCRIPT_CLIENT_DIR\u003e\n```\n\nYou should now be able to `require('jsflagr')` in javascript files from the directory you ran the last \ncommand above from.\n\n#### git\n#\nIf the library is hosted at a git repository, e.g.\nhttps://github.com/GIT_USER_ID/GIT_REPO_ID\nthen install it via:\n\n```shell\n    npm install GIT_USER_ID/GIT_REPO_ID --save\n```\n\n### For browser\n\nThe library also works in the browser environment via npm and [browserify](http://browserify.org/). After following\nthe above steps with Node.js and installing browserify with `npm install -g browserify`,\nperform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually \nuse this library):\n\n```shell\nbrowserify main.js \u003e bundle.js\n```\n\nThen include *bundle.js* in the HTML pages.\n\n### Webpack Configuration\n\nUsing Webpack you may encounter the following error: \"Module not found: Error:\nCannot resolve module\", most certainly you should disable AMD loader. Add/merge\nthe following section to your webpack config:\n\n```javascript\nmodule: {\n  rules: [\n    {\n      parser: {\n        amd: false\n      }\n    }\n  ]\n}\n```\n\n## Getting Started\n\nPlease follow the [installation](#installation) instruction and execute the following JS code:\n\n```javascript\nvar Jsflagr = require('jsflagr');\n\nvar api = new Jsflagr.ConstraintApi()\n\nvar flagID = 789; // {Number} numeric ID of the flag\n\nvar segmentID = 789; // {Number} numeric ID of the segment\n\nvar body = new Jsflagr.CreateConstraintRequest(); // {CreateConstraintRequest} create a constraint\n\n\nvar callback = function(error, data, response) {\n  if (error) {\n    console.error(error);\n  } else {\n    console.log('API called successfully. Returned data: ' + data);\n  }\n};\napi.createConstraint(flagID, segmentID, body, callback);\n\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *http://localhost/api/v1*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*Jsflagr.ConstraintApi* | [**createConstraint**](docs/ConstraintApi.md#createConstraint) | **POST** /flags/{flagID}/segments/{segmentID}/constraints | \n*Jsflagr.ConstraintApi* | [**deleteConstraint**](docs/ConstraintApi.md#deleteConstraint) | **DELETE** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} | \n*Jsflagr.ConstraintApi* | [**findConstraints**](docs/ConstraintApi.md#findConstraints) | **GET** /flags/{flagID}/segments/{segmentID}/constraints | \n*Jsflagr.ConstraintApi* | [**putConstraint**](docs/ConstraintApi.md#putConstraint) | **PUT** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} | \n*Jsflagr.DistributionApi* | [**findDistributions**](docs/DistributionApi.md#findDistributions) | **GET** /flags/{flagID}/segments/{segmentID}/distributions | \n*Jsflagr.DistributionApi* | [**putDistributions**](docs/DistributionApi.md#putDistributions) | **PUT** /flags/{flagID}/segments/{segmentID}/distributions | \n*Jsflagr.EvaluationApi* | [**postEvaluation**](docs/EvaluationApi.md#postEvaluation) | **POST** /evaluation | \n*Jsflagr.EvaluationApi* | [**postEvaluationBatch**](docs/EvaluationApi.md#postEvaluationBatch) | **POST** /evaluation/batch | \n*Jsflagr.ExportApi* | [**getExportEvalCacheJSON**](docs/ExportApi.md#getExportEvalCacheJSON) | **GET** /export/eval_cache/json | \n*Jsflagr.ExportApi* | [**getExportSqlite**](docs/ExportApi.md#getExportSqlite) | **GET** /export/sqlite | \n*Jsflagr.FlagApi* | [**createFlag**](docs/FlagApi.md#createFlag) | **POST** /flags | \n*Jsflagr.FlagApi* | [**deleteFlag**](docs/FlagApi.md#deleteFlag) | **DELETE** /flags/{flagID} | \n*Jsflagr.FlagApi* | [**findFlags**](docs/FlagApi.md#findFlags) | **GET** /flags | \n*Jsflagr.FlagApi* | [**getFlag**](docs/FlagApi.md#getFlag) | **GET** /flags/{flagID} | \n*Jsflagr.FlagApi* | [**getFlagEntityTypes**](docs/FlagApi.md#getFlagEntityTypes) | **GET** /flags/entity_types | \n*Jsflagr.FlagApi* | [**getFlagSnapshots**](docs/FlagApi.md#getFlagSnapshots) | **GET** /flags/{flagID}/snapshots | \n*Jsflagr.FlagApi* | [**putFlag**](docs/FlagApi.md#putFlag) | **PUT** /flags/{flagID} | \n*Jsflagr.FlagApi* | [**setFlagEnabled**](docs/FlagApi.md#setFlagEnabled) | **PUT** /flags/{flagID}/enabled | \n*Jsflagr.HealthApi* | [**getHealth**](docs/HealthApi.md#getHealth) | **GET** /health | \n*Jsflagr.SegmentApi* | [**createSegment**](docs/SegmentApi.md#createSegment) | **POST** /flags/{flagID}/segments | \n*Jsflagr.SegmentApi* | [**deleteSegment**](docs/SegmentApi.md#deleteSegment) | **DELETE** /flags/{flagID}/segments/{segmentID} | \n*Jsflagr.SegmentApi* | [**findSegments**](docs/SegmentApi.md#findSegments) | **GET** /flags/{flagID}/segments | \n*Jsflagr.SegmentApi* | [**putSegment**](docs/SegmentApi.md#putSegment) | **PUT** /flags/{flagID}/segments/{segmentID} | \n*Jsflagr.SegmentApi* | [**putSegmentsReorder**](docs/SegmentApi.md#putSegmentsReorder) | **PUT** /flags/{flagID}/segments/reorder | \n*Jsflagr.TagApi* | [**createTag**](docs/TagApi.md#createTag) | **POST** /flags/{flagID}/tags | \n*Jsflagr.TagApi* | [**deleteTag**](docs/TagApi.md#deleteTag) | **DELETE** /flags/{flagID}/tags/{tagID} | \n*Jsflagr.TagApi* | [**findAllTags**](docs/TagApi.md#findAllTags) | **GET** /tags | \n*Jsflagr.TagApi* | [**findTags**](docs/TagApi.md#findTags) | **GET** /flags/{flagID}/tags | \n*Jsflagr.VariantApi* | [**createVariant**](docs/VariantApi.md#createVariant) | **POST** /flags/{flagID}/variants | \n*Jsflagr.VariantApi* | [**deleteVariant**](docs/VariantApi.md#deleteVariant) | **DELETE** /flags/{flagID}/variants/{variantID} | \n*Jsflagr.VariantApi* | [**findVariants**](docs/VariantApi.md#findVariants) | **GET** /flags/{flagID}/variants | \n*Jsflagr.VariantApi* | [**putVariant**](docs/VariantApi.md#putVariant) | **PUT** /flags/{flagID}/variants/{variantID} | \n\n\n## Documentation for Models\n\n - [Jsflagr.Constraint](docs/Constraint.md)\n - [Jsflagr.CreateConstraintRequest](docs/CreateConstraintRequest.md)\n - [Jsflagr.CreateFlagRequest](docs/CreateFlagRequest.md)\n - [Jsflagr.CreateSegmentRequest](docs/CreateSegmentRequest.md)\n - [Jsflagr.CreateTagRequest](docs/CreateTagRequest.md)\n - [Jsflagr.CreateVariantRequest](docs/CreateVariantRequest.md)\n - [Jsflagr.Distribution](docs/Distribution.md)\n - [Jsflagr.Error](docs/Error.md)\n - [Jsflagr.EvalContext](docs/EvalContext.md)\n - [Jsflagr.EvalDebugLog](docs/EvalDebugLog.md)\n - [Jsflagr.EvalResult](docs/EvalResult.md)\n - [Jsflagr.EvaluationBatchRequest](docs/EvaluationBatchRequest.md)\n - [Jsflagr.EvaluationBatchResponse](docs/EvaluationBatchResponse.md)\n - [Jsflagr.EvaluationEntity](docs/EvaluationEntity.md)\n - [Jsflagr.Flag](docs/Flag.md)\n - [Jsflagr.FlagSnapshot](docs/FlagSnapshot.md)\n - [Jsflagr.Health](docs/Health.md)\n - [Jsflagr.PutDistributionsRequest](docs/PutDistributionsRequest.md)\n - [Jsflagr.PutFlagRequest](docs/PutFlagRequest.md)\n - [Jsflagr.PutSegmentReorderRequest](docs/PutSegmentReorderRequest.md)\n - [Jsflagr.PutSegmentRequest](docs/PutSegmentRequest.md)\n - [Jsflagr.PutVariantRequest](docs/PutVariantRequest.md)\n - [Jsflagr.Segment](docs/Segment.md)\n - [Jsflagr.SegmentDebugLog](docs/SegmentDebugLog.md)\n - [Jsflagr.SetFlagEnabledRequest](docs/SetFlagEnabledRequest.md)\n - [Jsflagr.Tag](docs/Tag.md)\n - [Jsflagr.Variant](docs/Variant.md)\n\n\n## Documentation for Authorization\n\n All endpoints do not require authorization.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenflagr%2Fjsflagr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenflagr%2Fjsflagr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenflagr%2Fjsflagr/lists"}