{"id":26063210,"url":"https://github.com/edgio/js-ectoken","last_synced_at":"2025-04-11T11:45:42.609Z","repository":{"id":222193036,"uuid":"755318783","full_name":"Edgio/js-ectoken","owner":"Edgio","description":"JavaScript implementation of ectoken","archived":false,"fork":false,"pushed_at":"2024-07-31T15:03:07.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-10T03:19:04.728Z","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/Edgio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","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":"2024-02-09T22:00:07.000Z","updated_at":"2024-07-31T15:01:54.000Z","dependencies_parsed_at":"2024-04-24T20:46:41.065Z","dependency_job_id":"7e108213-6185-4122-a0b1-e0c0e5bebf81","html_url":"https://github.com/Edgio/js-ectoken","commit_stats":null,"previous_names":["edgio/js-ectoken"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgio%2Fjs-ectoken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgio%2Fjs-ectoken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgio%2Fjs-ectoken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgio%2Fjs-ectoken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edgio","download_url":"https://codeload.github.com/Edgio/js-ectoken/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148350,"owners_count":21055565,"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":[],"created_at":"2025-03-08T16:33:47.090Z","updated_at":"2025-04-11T11:45:42.567Z","avatar_url":"https://github.com/Edgio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @edgio/ectoken\n\u003e _JavaScript implementation of Edgio token (`ectoken`)_\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Background\n\nJavaScript implementation of the \"Edgio Token\" (`ectoken`) - see main repo [ectoken](https://github.com/edgio/ectoken) for more details.\n\n## Install\n\n```\n$ npm install @edgio/ectoken\n```\n\n## Usage\n\n```js\nconst { ECToken, encrypt, decrypt } = require('@edgio/ectoken')\n\nconst ec_token = new ECToken()\nec_token.addValue('ec_country_allow', 'US')\n// Add additional directives in the same way.\n\nconst token = await encrypt('my-secret-key', ec_token)\nconst plaintext = await decrypt('my-secret-key', token)\n```\n\nIf installing this library as a replacement for [`ectoken-nodejs`](https://github.com/hattan/ectoken-nodejs), import the `V3` namespace instead:\n\n```js\nconst { V3 } = require('@edgio/ectoken')\n\nconst token = await V3.encrypt('my-secret-key', 'some_param=valueA\u0026some_other_param=valueB')\nconst plaintext = await V3.decrypt('my-secret-key', token)\n```\n\n**Please Note**: because this version of the token generator uses `crypto.subtle`, the `encrypt` and `decrypt` functions **are now asynchronous.**\n\nThe `ECToken` helper class is optional for both the namespaced and non-namespaced import variations. The `encrypt` function will accept either an `ECToken` object or a plain `string`.\n\n## Contribute\n\nWe welcome issues, questions, and pull requests.\n\n## License\n\nThis project is licensed under the terms of the Apache 2.0 open source license. Please refer to the `License-2.0.txt` file for the full terms.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgio%2Fjs-ectoken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgio%2Fjs-ectoken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgio%2Fjs-ectoken/lists"}