{"id":18352336,"url":"https://github.com/plughacker/malga-tokenization","last_synced_at":"2025-08-20T18:24:22.294Z","repository":{"id":218536734,"uuid":"742461550","full_name":"plughacker/malga-tokenization","owner":"plughacker","description":"Simple way to tokenize cards with Malga","archived":false,"fork":false,"pushed_at":"2025-08-01T19:35:43.000Z","size":661,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T19:10:04.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plughacker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-12T14:32:18.000Z","updated_at":"2025-08-01T19:35:24.000Z","dependencies_parsed_at":"2025-03-14T15:22:39.628Z","dependency_job_id":"d7782e6f-8519-4780-b40f-046602b95a2c","html_url":"https://github.com/plughacker/malga-tokenization","commit_stats":null,"previous_names":["plughacker/malga-tokenization"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/plughacker/malga-tokenization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fmalga-tokenization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fmalga-tokenization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fmalga-tokenization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fmalga-tokenization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plughacker","download_url":"https://codeload.github.com/plughacker/malga-tokenization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fmalga-tokenization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271362552,"owners_count":24746503,"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-20T02:00:09.606Z","response_time":69,"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-05T21:35:40.549Z","updated_at":"2025-08-20T18:24:22.283Z","avatar_url":"https://github.com/plughacker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg alt=\"Malga\" src=\"docs/assets/malga.png\" width=\"85\" /\u003e\n  \u003c/picture\u003e\n  \u003ch1\u003eMalga Tokenization SDK\u003c/h1\u003e\n\u003c/div\u003e\n\n![Tests](https://github.com/plughacker/malga-tokenization/actions/workflows/tests.yml/badge.svg)\n\nSimple way to tokenize cards with Malga\n\n## Getting Started\n\nFirst of all, you'll need to install our SDK into your project:\n\n```bash\nyarn add @malga/tokenization\n# or\nnpm install @malga/tokenization\n# or\npnpm add @malga/tokenization\n```\n\n1. Add the identification keys for each field involving card data in your form\n\n```html\n\u003cform onSubmit=\"{handleGetTokenId}\"\u003e\n  \u003csection\u003e\n    \u003cdiv className=\"form-group\"\u003e\n      \u003clabel htmlFor=\"card-number\"\u003eCard Number\u003c/label\u003e\n      \u003cdiv id=\"card-number\" className=\"form-control\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv className=\"form-group\"\u003e\n      \u003clabel htmlFor=\"card-holder-name\"\u003eCard Holder Name\u003c/label\u003e\n      \u003cdiv id=\"card-holder-name\" className=\"form-control\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv className=\"form-group\"\u003e\n      \u003clabel htmlFor=\"card-cvv\"\u003eCard CVV\u003c/label\u003e\n      \u003cdiv id=\"card-cvv\" className=\"form-control\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv className=\"form-group\"\u003e\n      \u003clabel htmlFor=\"card-expiration-date\"\u003eCard Expiration Date\u003c/label\u003e\n      \u003cdiv id=\"card-expiration-date\" className=\"form-control\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/section\u003e\n  \u003cbutton type=\"submit\"\u003eSubmit\u003c/button\u003e\n\u003c/form\u003e\n```\n\n2. Now all you need to do is configure our SDK with your keys and call the tokenize method in your function handling the form submit\n\n```ts\nimport { MalgaTokenization } from '@malga/tokenization'\n\nconst malgaTokenization = new MalgaTokenization({\n  apiKey: '\u003cYOUR_API_KEY\u003e',\n  clientId: '\u003cYOUR_CLIENT_ID\u003e',\n  options: {\n    config: {\n      fields: {\n        cardNumber: {\n          container: 'card-number',\n          placeholder: '9999 9999 9999 9999',\n        },\n        cardHolderName: {\n          container: 'card-holder-name',\n          placeholder: 'Its a test',\n        },\n        cardExpirationDate: {\n          container: 'card-expiration-date',\n          placeholder: 'MM/YY',\n        },\n        cardCvv: {\n          container: 'card-cvv',\n          placeholder: '999',\n        },\n      },\n      styles: {\n        // With this object, it's possible to change the styles of input components\n        input: {\n          color: '#000',\n          'font-size': '16px',\n        },\n      },\n      preventAutofill: false,\n    },\n    sandbox: true,\n  },\n})\n\n// You can use others events like:\nmalgaTokenization.on('cardTypeChanged', (event) =\u003e {\n  console.log('cardTypeChanged', event)\n})\n\nmalgaTokenization.on('validity', (event) =\u003e {\n  console.log('validation', event)\n})\n\nmalgaTokenization.on('blur', (event) =\u003e {\n  console.log('blur', event)\n})\n\nmalgaTokenization.on('focus', (event) =\u003e {\n  console.log('blur', event)\n})\n\nasync function handleSubmit(event) {\n  event.preventDefault()\n\n  const { tokenId } = await malgaTokenization.tokenize()\n  console.log({ tokenId })\n\n  // Now you just need to send the tokenId along with\n  // the rest of the transaction data to your API\n}\n```\n\n3. Submit the form and see the magic happen 💳\n\nFor more details on the implementation, you can access our documentation by [clicking here](https://docs.malga.io/docs/sdks/tokenization/intro).\n\n## Examples\n\nIf you have any doubts about the integration, you can [click here](https://github.com/plughacker/malga-tokenization/tree/main/examples) to see some examples\n\n## Contributing\n\nFeel free to contribute to this project by submitting pull requests, creating documentation, or bringing ideas to make the project even better!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplughacker%2Fmalga-tokenization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplughacker%2Fmalga-tokenization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplughacker%2Fmalga-tokenization/lists"}