{"id":38203443,"url":"https://github.com/conversationai/perspectiveapi-authorship-demo","last_synced_at":"2026-01-17T00:31:28.133Z","repository":{"id":23480621,"uuid":"88899650","full_name":"conversationai/perspectiveapi-authorship-demo","owner":"conversationai","description":"Example code to illustrate how to build an authorship experience using the perspective API","archived":false,"fork":false,"pushed_at":"2024-03-26T10:39:21.000Z","size":3237,"stargazers_count":64,"open_issues_count":27,"forks_count":26,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-04-13T03:40:10.670Z","etag":null,"topics":["angular2","google-cloud","perspective-api","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/conversationai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-04-20T18:48:07.000Z","updated_at":"2023-05-17T05:45:15.000Z","dependencies_parsed_at":"2024-02-13T22:50:36.463Z","dependency_job_id":null,"html_url":"https://github.com/conversationai/perspectiveapi-authorship-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/conversationai/perspectiveapi-authorship-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversationai%2Fperspectiveapi-authorship-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversationai%2Fperspectiveapi-authorship-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversationai%2Fperspectiveapi-authorship-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversationai%2Fperspectiveapi-authorship-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conversationai","download_url":"https://codeload.github.com/conversationai/perspectiveapi-authorship-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversationai%2Fperspectiveapi-authorship-demo/sbom","scorecard":{"id":303742,"data":{"date":"2025-08-11","repo":{"name":"github.com/conversationai/perspectiveapi-authorship-demo","commit":"caa657ae778c26dd44e34c1121c149e180292b4e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/conversationai/perspectiveapi-authorship-demo/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/conversationai/perspectiveapi-authorship-demo/node.js.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating gcr.io/google_appengine/nodejs to gcr.io/google_appengine/nodejs@sha256:1c585726fc3915489e23816fb20fabc92f31208f8d61cadf4ebb784dcf427c50","Warn: npmCommand not pinned by hash: Dockerfile:21","Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:29","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/conversationai/.github/SECURITY.md:1","Info: Found linked content: github.com/conversationai/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/conversationai/.github/SECURITY.md:1","Info: Found text in security policy: github.com/conversationai/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"103 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-36jr-mh4h-2g58","Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-6g8v-hpgw-h2v7","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-wgfq-7857-4jcc","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-36fh-84j7-cv5h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-4fc4-chg7-h8gh","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T21:27:03.929Z","repository_id":23480621,"created_at":"2025-08-17T21:27:03.929Z","updated_at":"2025-08-17T21:27:03.929Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T23:55:29.509Z","status":"ssl_error","status_checked_at":"2026-01-16T23:55:29.108Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["angular2","google-cloud","perspective-api","typescript"],"created_at":"2026-01-17T00:31:27.431Z","updated_at":"2026-01-17T00:31:28.114Z","avatar_url":"https://github.com/conversationai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Travis CI](https://travis-ci.org/conversationai/perspectiveapi-authorship-demo.svg?branch=master)](https://travis-ci.org/conversationai/perspectiveapi-authorship-demo) [![npm version](https://badge.fury.io/js/%40conversationai%2Fperspectiveapi-authorship-demo.svg)](https://badge.fury.io/js/%40conversationai%2Fperspectiveapi-authorship-demo)\n\n# An authorship experience demo for Perspective API\n\nThis repository contains example code for an authorship experience that provides feedback as you type using [Perspective API](http://www.perspectiveapi.com/). It is a web app written in\n[Angular2](https://angular.io/)/[TypeScript](https://www.typescriptlang.org/) and uses a [Node Express server](https://expressjs.com/). This project shows how to have a development and a production\nbuild environment with deployment tools based on [Docker](https://www.docker.com/). You can then deploy to cloud services such as [Google Cloud's App Engine](https://cloud.google.com/appengine/),\nas well as other cloud computing providers.\n\nThe app uses the [Perspective API](http://www.perspectiveapi.com/) to score text, via\n[perspectiveapi-simple-server](https://github.com/conversationai/perspectiveapi-simple-server).\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.\n\n## Requirements \u0026 Setup\n\nTo run code using your local machine (not via the Docker\nenvironment), you will need to install `nodejs` (e.g., by [installing NVM](https://github.com/creationix/nvm)).\nYou'll also need some global packages, which you can install using the `npm` command:\n\n```bash\nnpm install -g yarn typings typescript ts-node mocha protractor angular-cli karma-cli\n```\n\nNext, you will need to create a\n[Google Cloud (GCS)](http://cloud.google.com) project, and it will need to have access to [Perspective API](https://www.perspectiveapi.com). Requests to the API will be authenticated using a [Cloud project API key](https://support.google.com/cloud/answer/6158862?hl=en).\n\nAn example configuration file template is provided in `config/server_config.template.json`. If one is not present\nin `build/config`, then the config file will be copied there when you build or start a local server. The config\nfile specifies your Google Cloud project API key, and some other details which you can learn more about in the\n[documentation for perspectiveapi-simple-server](https://github.com/conversationai/perspectiveapi-simple-server/blob/master/README.md).\n\nTo setup and install the local packages, use [install yarn](https://yarnpkg.com/en/docs/install) and then run:\n\n```bash\nyarn install\n```\n\n### Adding reCAPTCHA v3 verification\n\nThe [perspectiveapi-simple-server](https://github.com/conversationai/perspectiveapi-simple-server) \nhas an optional configuration for enabling reCAPTCHA verification. To enable it in this demo, add the \nrequisite `recaptchaConfig` values to `server_config.json`. Then, provide [ng-recaptcha](https://github.com/DethAriel/ng-recaptcha)'s  `RecaptchaV3Service` and `RECAPTCHA_V3_SITE_KEY` to the module importing this demo, like so:\n\n```js\nproviders: [ \n  ReCaptchaV3Service,\n  {provide: RECAPTCHA_V3_SITE_KEY, useValue: 'your_site_key_for_reCAPTCHA_v3' },\n]\n```\n\n## Development server that watches the source code\n\nRun `yarn run serve` for a dev server. Navigate to `http://localhost:4200/`.\nThe app will automatically reload if you change any of the source files.\nAPI requests to the server (`http://localhost:4200/check` and\n`http://localhost:4200/suggest_score`) will be redirected to an underlying nodejs server,\nbased on [perspectiveapi-simple-server](https://github.com/conversationai/perspectiveapi-simple-server),\nwhich is started at `http://localhost:8080/`.\n\n## Development server that uses compiled sources\n\nBuilds the app in `build/static`:\n\n```bash\nyarn build:dev\n```\n\nStart the simple server at `http://localhost:8080/` serving content from `build/static`:\n\n```bash\nyarn run start:dev-server\n```\n\n## Production server that uses compiled sources\n\nTo build the production version of the app in `build/static`, which will compile the HTML, JS and CSS\nand do cool shakedown stuff to minimize the size, run:\n\n```\nyarn build:prod\n```\n\nYou can now run the simple server at `http://localhost:8080/` serving content from `build/static`:\n\n```bash\nyarn run start:dev-server\n```\n\nWhen run using the Dockerfile, e.g. on [Google Cloud](https://cloud.google.com/sdk/gcloud/), the following\ncommand will be run:\n\n```bash\nyarn run start:prod-server\n```\n\nIf you run this locally, you'll need to [login to Google Cloud and set your project ID](https://cloud.google.com/sdk/docs/initializing).\nIf you run this locally, you'll need to [login to Google Cloud and set your project ID](https://cloud.google.com/sdk/docs/initializing).\n\n## Production server using docker file\n\nAssuming you have [Docker](https://www.docker.com/) installed and setup, you can create a Docker image for the\nproduction server with:\n\n```bash\ndocker build -t perspectiveapi-authorship-demo .\n```\n\nTo start a shell in the Docker environment for debugging and to manually start\nthe server there, you can run:\n\n```bash\ndocker run -ti perspectiveapi-authorship-demo /bin/bash\n```\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.\n\n## Build\n\nRun `yarn run build` to build the project. The build artifacts will be stored in the `build/` directory. Use the\n`-prod` flag for a production build.\n\n## Running unit tests\n\nRun `yarn run test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `yarn run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\nBefore running the tests make sure you are serving the app via `ng serve`.\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n\n## Using convai-checker as a webcomponent\n\nAngular Elements is a new experimental API that allows exporting Angular\ncomponents as webcomponents. This repo includes a demo of this functionality\nwith the convai-checker component. To see it, do the following:\n\n1. Build with the command `yarn run build:dev-customElements`.\n2. Run `yarn run start:dev-server`\n3. Open http://localhost:8080/index_with_elements.html.\n\nTODO(rachelrosen): Document and demo how to add convai-checker webcomponent outside of the angular-cli build using the imported compiled javascript.\n\n### Publishing the webcomponent\n\nTo publish a new version of the convai-checker webcomponent, that can be used as a plugin in other websites (e.g. WordPress):\n1. Run `yarn run build-plugin-js`.  This will concatenate all JavaScript files into one `build/static/perspective_authorship_widget.js` file.\n2. Copy the new JavaScript to GCS with `gsutil cp build/static/perspective_authorship_widget.js gs://checker_source/`\n3. Copy asset files (emoji images) to GCS with `gsutil cp src/assets/* gs://checker_source/assets`\n4. Open (https://pantheon.corp.google.com/storage/browser/checker_source) and ensure that perspective_authorship_widget.js and all files in the assets directory have \"Public link\" checked.  TODO(dborkan): automate this step\n\n## Publishing to npm\n\nTo package the library for publication, we use [ng-packagr](https://github.com/dherges/ng-packagr).\n\nRun `yarn run packagr` to build the javascript bundles, which will generate a\n`dist/` directory. Then run `npm publish dist` to publish the contents of that\ndirectory.\n\n### Important note\n\nWhen using this library in another package, in order to access the image assets\nfor emoji mode, you must add the assets from this package to the assets in your\nangular.json:\n\n\"assets\": [\n   {\n     \"glob\": \"*\",\n     \"input\": \"node_modules/@conversationai/perspectiveapi-authorship-demo/src/assets\",\n     \"output\": \"./assets\"\n   }\n]\n\nSee https://github.com/angular/angular-cli/issues/3555#issuecomment-285187411\nand https://github.com/angular/angular-cli/pull/4691 for more info.\n\n## Notes\n\nThis is example code to help experimentation with Perspective API; it is not an official Google product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconversationai%2Fperspectiveapi-authorship-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconversationai%2Fperspectiveapi-authorship-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconversationai%2Fperspectiveapi-authorship-demo/lists"}