{"id":30285607,"url":"https://github.com/friendlycaptcha/friendly-captcha-salesforce","last_synced_at":"2026-02-10T03:02:47.642Z","repository":{"id":309117018,"uuid":"1033812922","full_name":"FriendlyCaptcha/friendly-captcha-salesforce","owner":"FriendlyCaptcha","description":"Source code for \"Friendly Captcha for Salesforce\"","archived":false,"fork":false,"pushed_at":"2025-08-07T13:54:23.000Z","size":1885,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T00:35:01.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Apex","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendlyCaptcha.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,"zenodo":null}},"created_at":"2025-08-07T11:37:54.000Z","updated_at":"2025-08-07T14:30:52.000Z","dependencies_parsed_at":"2025-08-10T14:32:04.958Z","dependency_job_id":null,"html_url":"https://github.com/FriendlyCaptcha/friendly-captcha-salesforce","commit_stats":null,"previous_names":["friendlycaptcha/friendly-captcha-salesforce"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/FriendlyCaptcha/friendly-captcha-salesforce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-salesforce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-salesforce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-salesforce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-salesforce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendlyCaptcha","download_url":"https://codeload.github.com/FriendlyCaptcha/friendly-captcha-salesforce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-salesforce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270763461,"owners_count":24641026,"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-16T02:00:11.002Z","response_time":91,"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":"2025-08-16T20:07:33.439Z","updated_at":"2026-02-10T03:02:45.003Z","avatar_url":"https://github.com/FriendlyCaptcha.png","language":"Apex","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Friendly Captcha for Salesforce\n\nThis project contains the source code for the Salesforce integration for Friendly Captcha. Much (all?) of this repository was generated using the `sf` command line tool. You can install it [from their website][sf-website] or [from npm][sf-npm].\n\nYou can also run it as a Docker container, which I've started doing recently.\n\n```\ndocker run --rm -it -v $PWD:/app -w /app salesforce/cli:latest-full\n```\n\nThat will drop you into a shell with the `sf` command installed.\n\n## Map of the repository\n\nAll source is located in `force-app/main/default`.\n\n```\nforce-app\n└── main\n    └── default\n        ├── classes\n        │   └──\u003e Apex classes\n        ├── cspTrustedSites\n        │   └──\u003e Stored CSP configuration\n        ├── customMetadata\n        │   └──\u003e Records (aka instances of) a Custom Metadata Type (CMDT)\n        ├── layouts\n        │   └──\u003e XML markup for a CMDT record page.\n        ├── lwc\n        │   └──\u003e Lightning web components\n        ├── objects\n        │   └──\u003e Custom metadata types (CMDTs)\n        ├── remoteSiteSettings\n        │   └──\u003e Store trusted site settings for HTTP requests (to siteverify API)\n        └── staticresources\n            └──\u003e Static files, including test fixtures and also the front-end SDK.\n```\n\nEverything in `cspTrustedSites`, `customMetadata`, `layouts`, `objects`, and `remoteSiteSettings` should _pretty much_ never need to change.\n\nThe three main components of this project are the Apex classes, the LWC, and the Custom Metadata Type (CMDT).\n\n### Apex Classes\n\nLocated in `force-app/main/default/classes`. This code makes up the back-end code for the integration, and handles performing the siteverify request and parsing the response.\n\n### LWC\n\nLocated in `force-app/main/default/lwc`. This is a front-end component that wraps and manages a Friendly Captcha Widget. It's meant to be used in Salesforce UIs that support LWCs.\n\n### CMDT\n\nThe CMDT is basically a data type that stores the configuration parameters for the integration. For this project, those parameters are `sitekey`, `apiEndpoint`, `apiKey`, `strict`, `timeout`, `startMode`, `theme`, and `language`. The code for it is split across the `customMetadata`, `layouts`, and `objects` directories. In short, `objects` contains the definition of the CMDT (named `Config__mdt`), `customMetadata` contains a _record_ of that object with some default values, and `layouts` defines a page for managing instances of the CMDT within the Salesforce Setup UI.\n\n## Development Workflow\n\nSalesforce development doesn't really happen locally; everything happens within Salesforce orgs. You make changes to your code and then deploy it to an ephemeral \"Scratch\" org, where you can interact with it or run tests. To create scratch orgs, you have to first log into a Dev Hub org.\n\n### CLI Authentication\n\nYou log into the Dev Hub org via\n\n```\nsf org login web --set-default-dev-hub\n```\n\nThis will open a web browser where you log in with your Salesforce Dev Hub credentials. Upon successful authentication, you'll see a success message, and your command line session should be authenticated.\n\nIf you're in the Docker container, you probably will want to use\n\n```\nsf org login device --set-default-dev-hub\n```\n\nIf everything is successful, you'll see your org in the output when you run `sf org list`.\n\n### Create a scratch org and deploy the code\n\nUse the following command to create a scratch org to develop against.\n\n```\nsf org create scratch --alias MyScratch --definition-file config/project-scratch-def.json\n```\n\nWhen it's done, you'll see it in the output of `sf org list`. You can then deploy your code to the scratch org:\n\n```\nsf project deploy start --target-org MyScratch\n```\n\nYou'll see a bunch of resources get created in the output. Now your code is the org, and you can open the org and start exploring and testing.\n\n```\nsf org open --target-org MyScratch\n```\n\nIf in Docker,\n\n```\nsf org open --target-org MyScratch --url-only\n```\n\nThen copy and paste the URL into your browser.\n\n### Running the tests\n\nThis command runs the Apex tests synchronously and outputs the results upon completion:\n\n```\nsf apex run test --target-org MyScratch --synchronous\n```\n\nYou can add the `--code-coverage` flag (optionally with `--detailed-coverage`) to generate a basic code coverage report.\n\n### Deleting a scratch org\n\n```\nsf org delete scratch --target-org MyScratch\n```\n\n## Typical development tasks\n\nIf you want to change the site verification behavior, you'll make changes to the Apex classes. To change the behavior of the widget, you can update the LWC.\n\n### Upgrading the SDK version\n\nThe SDK ships bundled as a Static Resource (in `force-app/main/default/staticresources`). To update it, copy the desired version of `site.compat.min.js` into `force-app/main/default/staticresources/FriendlyCaptchaSDK.js`.\n\n## Generating Apex Documentation\n\nDocumentation for the Apex classes is generated using [`@cparra/apexdocs`][apexdocs]. You can run the following command to generate docs in to the `docs/` folder.\n\n```\nrm -rf docs\nnpm run docs\n```\n\nYou can then copy the contents of the folder to [friendly-docs][friendly-docs]:\n\n```\nrm -rf /path/to/friendly-docs/src/pages/integrations/salesforce/reference\ncp -R docs /path/to/friendly-docs/src/pages/integrations/salesforce/reference\n```\n\n## License\n\nThis is free software; you can redistribute it and/or modify it under the terms of the [Mozilla Public License Version 2.0](./LICENSE).\n\n[sf-website]: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm\n[sf-npm]: https://www.npmjs.com/package/@salesforce/cli\n[apexdocs]: https://github.com/cesarParra/apexdocs\n[friendly-docs]: https://github.com/FriendlyCaptcha/friendly-docs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-salesforce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-salesforce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-salesforce/lists"}