{"id":20215556,"url":"https://github.com/casdoor/casdoor-react-native-sdk","last_synced_at":"2026-04-07T22:31:07.158Z","repository":{"id":192090243,"uuid":"685906638","full_name":"casdoor/casdoor-react-native-sdk","owner":"casdoor","description":"React Native client SDK for Casdoor","archived":false,"fork":false,"pushed_at":"2025-10-14T14:33:01.000Z","size":235,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-02T02:59:39.356Z","etag":null,"topics":["auth","authentication","authn","casdoor","iam","javascript","js","react","react-native","sdk","sso","ts","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/casdoor/casdoor","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/casdoor.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}},"created_at":"2023-09-01T09:28:44.000Z","updated_at":"2025-10-14T14:33:05.000Z","dependencies_parsed_at":"2023-09-02T14:16:18.985Z","dependency_job_id":"9ef30419-77f5-4eee-857c-d4f936c33eef","html_url":"https://github.com/casdoor/casdoor-react-native-sdk","commit_stats":null,"previous_names":["casdoor/casdoor-react-native-sdk"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/casdoor/casdoor-react-native-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-react-native-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-react-native-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-react-native-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-react-native-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casdoor","download_url":"https://codeload.github.com/casdoor/casdoor-react-native-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-react-native-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31532150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"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":["auth","authentication","authn","casdoor","iam","javascript","js","react","react-native","sdk","sso","ts","typescript"],"created_at":"2024-11-14T06:23:13.745Z","updated_at":"2026-04-07T22:31:07.140Z","avatar_url":"https://github.com/casdoor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# casdoor-react-native-sdk\n\n[![GitHub Actions](https://github.com/casdoor/casdoor-react-native-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/casdoor/casdoor-react-native-sdk/actions/workflows/build.yml)\n[![Coverage Status](https://codecov.io/gh/casdoor/casdoor-react-native-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/casdoor/casdoor-react-native-sdk)\n[![NPM version][npm-image]][npm-url]\n[![NPM download][download-image]][download-url]\n[![Release](https://img.shields.io/github/release/casdoor/casdoor-react-native-sdk.svg)](https://github.com/casdoor/casdoor-react-native-sdk/releases/latest)\n[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord\u0026label=discord\u0026color=5865F2)](https://discord.gg/5rPsrAzK7S)\n\n[npm-image]: https://img.shields.io/npm/v/casdoor-react-native-sdk.svg?style=flat-square\n\n[npm-url]: https://npmjs.com/package/casdoor-react-native-sdk\n\n[download-image]: https://img.shields.io/npm/dm/casdoor-react-native-sdk.svg?style=flat-square\n\n[download-url]: https://npmjs.com/package/casdoor-react-native-sdk\nThis is Casdoor's SDK for react-native will allow you to easily connect your application to the Casdoor authentication system\nwithout having to implement it from scratch.\n\nCasdoor SDK is very simple to use. We will show you the steps below.\n\n## Usage in NPM environment\n\n### Installation\n\n~~~shell script\n# NPM\nnpm i casdoor-react-native-sdk\n\n# Yarn\nyarn add casdoor-react-native-sdk\n~~~\n\n### Init SDK\n\nInitialization requires 7 parameters, which are all string type:\n\n| Name (in order)  | Must | Description                                         |\n| ---------------- | ---- | --------------------------------------------------- |\n| serverUrl  | Yes  | your Casdoor server URL               |\n| clientId         | Yes  | the Client ID of your Casdoor application|\n| appName           | Yes  | the name of your Casdoor application |\n| organizationName     | Yes  | the name of the Casdoor organization connected with your Casdoor application                    |\n| redirectPath     | No  | the path of the redirect URL for your Casdoor application, will be `/callback` if not provided              |\n| signinPath     | No  | the path of the signin URL for your Casdoor application, will be `/api/signin` if not provided              |\n\n```typescript\nimport SDK from 'casdoor-react-native-sdk'\n\nconst sdkConfig = {\n  serverUrl: 'https://door.casdoor.com',\n  clientId: 'b800a86702dd4d29ec4d',\n  appName: 'app-example',\n  organizationName: 'casbin',\n  redirectPath: 'http://localhost:5000/callback',\n  signinPath: '/api/signin',\n};\nconst sdk = new SDK(sdkConfig)\n// call sdk to handle\n```\n\n## Usage in vanilla Javascript\n\n### Import and init SDK\n\nInitialization parameters are consistent with the previous node.js section:\n\n```javascript\n\u003c!--init the SDK--\u003e\n  import SDK from 'casdoor-react-native-sdk'\n  const sdkConfig = {\n    serverUrl: 'https://door.casdoor.com',\n    clientId: 'b800a86702dd4d29ec4d',\n    appName: 'app-example',\n    organizationName: 'casbin',\n    redirectPath: 'http://localhost:5000/callback',\n    signinPath: '/api/signin',\n  };\n  const sdk = new SDK(sdkConfig)\n```\n\n### Call functions in SDK\n\n```javascript\n  // call sdk to handle\n  sdk.getSignupUrl();\n```\n\n## API reference interface\n\n#### Get sign up url\n\n```typescript\ngetSignupUrl()\n```\n\nReturn the casdoor url that navigates to the registration screen\n\n#### Get sign in url\n\n```typescript\ngetSigninUrl()\n```\n\nReturn the casdoor url that navigates to the login screen\n\n#### Get user profile page url\n\n```typescript\ngetUserProfileUrl(userName, account)\n```\n\nReturn the url to navigate to a specific user's casdoor personal page\n\n#### Get my profile page url\n\n```typescript\ngetMyProfileUrl(account)\n```\n\n#### getAccessToken\n\n```typescript\ngetAccessToken(redirectUrl); // http://localhost:5000/callback?code=b75bc5c5ac65ffa516e5\u0026state=gjmfdgqf498\n```\n\nHandle the callback url from casdoor, call the back-end api to complete the login process\n\n#### Determine whether silent sign-in is being used\n\n```typescript\nisSilentSigninRequested()\n```\n\nWe usually use this method to determine if silent login is being used. By default, if the silentSignin parameter is included in the URL and equals one, this method will return true. Of course, you can also use any method you prefer.\n\n#### silentSignin\n\n````typescript\nsilentSignin(onSuccess, onFailure)\n````\n\nFirst, let's explain the two parameters of this method, which are the callback methods for successful and failed login. Next, I will describe the execution process of this method. We will create a hidden \"iframe\" element to redirect to the login page for authentication, thereby achieving the effect of silent sign-in.\n\n#### JwtDecode\n\n````typescript\nJwtDecode(jwtToken)\n````\n\n\n## More examples\n\nTo see how to use SDK, you can refer to [casdoor-react-native-example](https://github.com/casdoor/casdoor-react-native-example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-react-native-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasdoor%2Fcasdoor-react-native-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-react-native-sdk/lists"}