{"id":28383875,"url":"https://github.com/simple-login/sdk.js","last_synced_at":"2025-06-25T22:31:09.609Z","repository":{"id":36744720,"uuid":"201889069","full_name":"simple-login/sdk.js","owner":"simple-login","description":"SimpleLogin JS SDK","archived":false,"fork":false,"pushed_at":"2022-07-07T11:16:33.000Z","size":134,"stargazers_count":4,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T13:15:37.771Z","etag":null,"topics":["sdk","simplelogin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/simple-login.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-12T08:28:04.000Z","updated_at":"2024-06-02T05:23:09.000Z","dependencies_parsed_at":"2022-09-07T09:00:52.779Z","dependency_job_id":null,"html_url":"https://github.com/simple-login/sdk.js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/simple-login/sdk.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-login%2Fsdk.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-login%2Fsdk.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-login%2Fsdk.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-login%2Fsdk.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simple-login","download_url":"https://codeload.github.com/simple-login/sdk.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simple-login%2Fsdk.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259579432,"owners_count":22879438,"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":["sdk","simplelogin"],"created_at":"2025-05-30T07:38:11.583Z","updated_at":"2025-06-25T22:31:09.596Z","avatar_url":"https://github.com/simple-login.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleLogin sdk.js\n\nThe [SimpleLogin](https://simplelogin.io) sdk.js library is created to facilitate adding SimpleLogin button to your webapp.\n\nThe SDK is based on [hello.js](https://github.com/MrSwitch/hello.js).\n\nTo use it, first include the SDK into the html and add the \"Login with SimpleLogin\" button:\n\n```html\n\u003cbutton id=\"btn-simplelogin\"\u003eLogin with Simplelogin\u003c/button\u003e\n\u003cdiv id=\"user-info\"\u003e\u003c/div\u003e\n\n\u003cscript src=\"https://simplelogin.io/sdk/sdk.js\"\u003e\u003c/script\u003e\n```\n\nSecond, use it to log user in. Please make sure to replace `{your SimpleLogin client-oauth-id}`.\n\n```js\nSL.init(\"{your SimpleLogin client-oauth-id}\");\n\ndocument.getElementById(\"btn-simplelogin\").onclick = function(e) {\n  SL.login(function(user) {\n    console.log(\"got user from SL SDK\", user);    \n\n    document.getElementById(\"user-info\").innerHTML = `\n    email: ${user.email} \u003cbr\u003e\n    name: ${user.name} \u003cbr\u003e\n    avatar: \u003cimg src=\"${user.avatar_url}\"\u003e\n    `\n  })\n}\n```\n\nVoilà, simple (as in SimpleLogin) isn't it 😉?\n\nThis example also included in [example](./example)\n\n## Doc:\n\nAdding the SDK will add the object `SL` to `window`. There are 2 main methods:\n\n`SL.init(\"your oauth client id\")`: init SDK\n\n`SL.login(callback)`: once user is logged in, `callback` will be called with `user` as parameter.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-login%2Fsdk.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimple-login%2Fsdk.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimple-login%2Fsdk.js/lists"}