https://github.com/rhdeck/expo-amplify-appauth
Easy Hook to Connect Amplify Auth with Expo AppAuth implementation
https://github.com/rhdeck/expo-amplify-appauth
Last synced: 11 months ago
JSON representation
Easy Hook to Connect Amplify Auth with Expo AppAuth implementation
- Host: GitHub
- URL: https://github.com/rhdeck/expo-amplify-appauth
- Owner: rhdeck
- License: mit
- Created: 2021-06-01T11:44:37.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-02T00:23:10.000Z (about 5 years ago)
- Last Synced: 2025-06-24T05:41:29.924Z (12 months ago)
- Language: TypeScript
- Size: 241 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Template for making easy-to-work-with tempates
# expo-amplify-appauth
## The Problem
AppAuth is awesome! It works great getting an authentication code for AWS Cognito! Then things break down. This package wraps AppAuth `promptAsync` pattern to automatically populate the `Auth` and `Credentials` objects from AWS Amplify front-end components to allow seamless communication with Cognito-authenticated AWS services.
This has been tested on user pools, but not identity pools.
expo-amplify-appauth - v1.0.1
# expo-amplify-appauth - v1.0.1
## Table of contents
### References
- [default](#default)
### Functions
- [useAmplifyAppAuth](#useamplifyappauth)
## References
### default
Renames and exports: [useAmplifyAppAuth](#useamplifyappauth)
## Functions
### useAmplifyAppAuth
▸ **useAmplifyAppAuth**(`config`): `Object`
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `config` | `Object` | Options for initializing Amplify authentication using AppAuth in Expo |
| `config.authorizationEndpoint?` | `string` | - |
| `config.clientId` | `string` | - |
| `config.clientSecret?` | `string` | - |
| `config.domain?` | `string` | - |
| `config.endPoint?` | `string` | - |
| `config.region?` | `string` | - |
| `config.scopes?` | `string`[] | Oauth scopes (defaults to [openid], which is fine for most use cases) |
| `config.tokenEndpoint?` | `string` | - |
| `config.userPoolId` | `string` | - |
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `currentUser` | `undefined` \| `CognitoUser` |
| `error` | `undefined` \| `string` |
| `isLoggedIn` | `boolean` |
| `loading` | `boolean` |
| `promptAsync` | (...`args`: `any`[]) => `Promise` |
#### Defined in
[index.ts:38](https://github.com/rhdeck/expo-amplify-appauth/blob/643b9f4/src/index.ts#L38)