{"id":27024245,"url":"https://github.com/crossplatformsweden/react-native-cross-cognito","last_synced_at":"2026-05-05T21:34:41.078Z","repository":{"id":57336320,"uuid":"160690761","full_name":"crossplatformsweden/react-native-cross-cognito","owner":"crossplatformsweden","description":"React-Native implementation of AWS Cognito and Amplify SDK including login screens","archived":false,"fork":false,"pushed_at":"2019-02-01T14:33:13.000Z","size":448,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T13:11:27.460Z","etag":null,"topics":["amplify","authentication","aws-amplify","aws-amplify-react-native","aws-cognito","aws-cognito-react","crossplatform","javascript","login","react-native","typescript"],"latest_commit_sha":null,"homepage":"https://aws.amazon.com/cognito/","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/crossplatformsweden.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}},"created_at":"2018-12-06T15:02:37.000Z","updated_at":"2019-02-01T14:30:46.000Z","dependencies_parsed_at":"2022-09-11T10:03:02.743Z","dependency_job_id":null,"html_url":"https://github.com/crossplatformsweden/react-native-cross-cognito","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplatformsweden%2Freact-native-cross-cognito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplatformsweden%2Freact-native-cross-cognito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplatformsweden%2Freact-native-cross-cognito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplatformsweden%2Freact-native-cross-cognito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crossplatformsweden","download_url":"https://codeload.github.com/crossplatformsweden/react-native-cross-cognito/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249528,"owners_count":20908213,"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":["amplify","authentication","aws-amplify","aws-amplify-react-native","aws-cognito","aws-cognito-react","crossplatform","javascript","login","react-native","typescript"],"created_at":"2025-04-04T21:18:52.485Z","updated_at":"2026-05-05T21:34:36.046Z","avatar_url":"https://github.com/crossplatformsweden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crossplatform](https://crossplatform.se/wp-content/uploads/2018/05/Crossplatform-Sweden-AB-01_web.jpg)](https://www.crossplatform.se/)\n\n\u003c!-- language-all: javascript --\u003e\n\n# Crossplatform React-Native Cognito\n\nReact-Native implementation of [AWS Cognito](https://aws.amazon.com/cognito/) and [Amplify SDK](https://aws-amplify.github.io/docs/js/start?ref=amplify-rn-btn\u0026platform=react-native#step-4-integrate-aws-resources) including login screens\n\n## [Show me Components!](#components)\n\n## Install\n\nThis package makes use of our **[react-native-cross-components](https://github.com/crossplatformsweden/react-native-components)** that are based on on `react-native-paper`. Paper which is therefore a peer dependency.\n\n### Native\n\nInstall with [aws amplify](https://aws-amplify.github.io/docs/js/tutorials/building-react-native-apps/) and link it.\n\n```bash\n\tnpm i react-native-vector-icons\n\tnpm i aws-amplify\n\tnpm i react-native-paper\n\tnpm i react-native-cross-cognito\n\n\t# one liner\n\tnpm i react-native-vector-icons aws-amplify react-native-paper react-native-cross-cognito\n```\n\n```bash\n\tyarn add react-native-vector-icons\n\tyarn add aws-amplify\n\tyarn add react-native-paper\n\tyarn add react-native-cross-cognito\n\n\t# one liner\n\tyarn add react-native-vector-icons aws-amplify react-native-paper react-native-cross-cognito\n```\n\n### Expo prev CRNA\n\n```bash\n\tnpm i react-native-cross-cognito\n```\n\n```bash\n\tyarn add react-native-cross-cognito\n```\n\n## Documentation\n\nSee our GitHub Pages generated from code comments. This documentation is also available as intellisense / auto complete.\n\n- **[API Documentation](https://crossplatformsweden.github.io/react-native-cross-cognito/)**\n\nSee **[Components](#components)** below for examples\n\n---\n\n[![npm](https://img.shields.io/npm/v/react-native-cross-cognito.svg)](https://www.npmjs.com/package/react-native-cross-cognito) [![npm](https://img.shields.io/npm/dt/react-native-cross-cognito.svg)](https://www.npmjs.com/package/react-native-cross-cognito) [![Build status](https://crossplatformsweden.visualstudio.com/ParkeraApp/_apis/build/status/react-native-cross-cognito-CI)](https://crossplatformsweden.visualstudio.com/ParkeraApp/_build/latest?definitionId=16) ![GitHub](https://img.shields.io/github/license/crossplatformsweden/react-native-cross-cognito.svg)\n\n[![codecov](https://codecov.io/gh/crossplatformsweden/react-native-cross-cognito/branch/master/graph/badge.svg)](https://codecov.io/gh/crossplatformsweden/react-native-cross-cognito) [![dependencies](https://david-dm.org/crossplatformsweden/react-native-cross-cognito/status.svg)](https://david-dm.org/crossplatformsweden/react-native-cross-cognito) [![peer dependencies](https://img.shields.io/david/peer/crossplatformsweden/react-native-cross-cognito.svg)](https://github.com/crossplatformsweden/react-native-cross-cognito) [![Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n[![aws-amplify](https://img.shields.io/badge/AWS%20Amplify-v1.1.17-blue.svg)](https://github.com/aws-amplify/amplify-js) [![react-native-cross-components](https://img.shields.io/badge/React%20Native%20Cross%20Components-v0.2.7-blue.svg)](https://github.com/crossplatformsweden/react-native-components)\n\n[![GitHub forks](https://img.shields.io/github/forks/crossplatformsweden/react-native-cross-cognito.svg?style=social\u0026label=Fork)](https://github.com/crossplatformsweden/react-native-cross-cognito)\n[![GitHub stars](https://img.shields.io/github/stars/crossplatformsweden/react-native-cross-cognito.svg?style=social\u0026label=Star)](https://github.com/crossplatformsweden/react-native-cross-cognito) [![GitHub watchers](https://img.shields.io/github/watchers/crossplatformsweden/react-native-cross-cognito.svg?style=social\u0026label=Watch)](https://github.com/crossplatformsweden/react-native-cross-cognito) [![Twitter Follow](https://img.shields.io/twitter/follow/crossplatformse.svg?style=social)](https://twitter.com/crossplatformse)\n\n## Table of Contents\n\n- [Install](#install)\n  - [Native](#native)\n  - [Expo prev CRNA](#expo-prev-crna)\n- [Documentation](#documentation)\n- [Services and helpers](#services-and-helpers)\n  - [GetJwtToken](#getjwttoken)\n- [Components](#components)\n  - [CognitoLogin](#cognitologin)\n\n\u003csmall\u003e\u003ci\u003e\u003ca href='http://ecotrust-canada.github.io/markdown-toc/'\u003eTable of contents generated with markdown-toc\u003c/a\u003e\u003c/i\u003e\u003c/small\u003e\n\n## Services and helpers\n\n### GetJwtToken\n\nGets the current user's Jwt token from AWS Cognito.\n\nFor documentation see **[API reference - GetJwtToken](https://crossplatformsweden.github.io/react-native-cross-cognito/modules/_jwt_getjwttoken_.html)**.\n\n```typescript\nimport { GetJwtToken } from 'react-native-cross-cognito';\n\nconst myToken = await GetJwtToken();\n```\n\n## Components\n\n### CognitoLogin\n\n![](https://media.giphy.com/media/TGMBAkTYs1Xhojabxl/giphy.gif)\n\nRenders a complete login form using your Amplify token.\n\nFor properties and documentation, see **[API reference - Class CognitoLogin](https://crossplatformsweden.github.io/react-native-cross-cognito/classes/_login_components_cognitologin_.cognitologin.html)**.\n\n**Examples**\n\nWith success callback\n\n```typescript\n\timport { CognitoLogin } from 'react-native-cross-cognito';\n\timport amplify from './aws-exports';\n\n\tAmplify.configure(amplify);\n\n\texport const MyComp =\u003e () =\u003e (\n\t\t\u003cCognitoLogin\n\t\t\tonRegisteredUser={(user) =\u003e {\n\t\t\t\tAlert.alert('Registration complete', 'Thank you ' + user.getUsername());\n\t\t\t}}\n\t\t\tonLoggedIn={(user) =\u003e {\n\t\t\t\tAlert.alert('Logged in', 'Welcome ' + user.getUsername());\t\t\t}} /\u003e\n\t);\n```\n\nSet initial form\n\n```typescript\n\timport { CognitoLogin } from 'react-native-cross-cognito';\n\timport amplify from './aws-exports';\n\n\tAmplify.configure(amplify);\n\n\texport const MyComp =\u003e () =\u003e (\n\t\t\u003cCognitoLogin activeForm='Register' /\u003e\n\t);\n```\n\nWith button customizations\n\n```typescript\n\timport { CognitoLogin } from 'react-native-cross-cognito';\n\timport amplify from './aws-exports';\n\n\tAmplify.configure(amplify);\n\n\texport const MyComp =\u003e () =\u003e (\n        \u003cCognitoLogin\n          buttonProps={{ mode: 'text' }}\n          loginButtonProps={{ mode: 'contained', title: 'ENGAGE!' }}\n          /\u003e\n\t);\n```\n\nWith custom children\n\n```typescript\n\timport { CognitoLogin } from 'react-native-cross-cognito';\n\timport amplify from './aws-exports';\n\n\tAmplify.configure(amplify);\n\n\texport const MyComp =\u003e () =\u003e (\n        \u003cCognitoLogin\n          registerChildren={\n            \u003cText\n              style={{\n                color: 'blue',\n                fontWeight: 'bold',\n                margin: 10,\n                fontSize: 16,\n              }}\n            \u003e\n              \u0026lt;ENLIST NOW\u0026gt;\n            \u003c/Text\u003e\n          }\n        \u003e\n          \u003cText\n            style={{\n              color: 'red',\n              fontWeight: 'bold',\n              margin: 10,\n              fontSize: 16,\n            }}\n          \u003e\n            * \u0026lt;WARNING: RESTRICTED AREA\u0026gt; :)\n          \u003c/Text\u003e\n        \u003c/CognitoLogin\u003e\n\t);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossplatformsweden%2Freact-native-cross-cognito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrossplatformsweden%2Freact-native-cross-cognito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossplatformsweden%2Freact-native-cross-cognito/lists"}