Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adding typescript block to react getting started #6585

Merged
merged 14 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,22 @@ function App() {

</InlineFilter>

### Custom Providers
nadetastic marked this conversation as resolved.
Show resolved Hide resolved

When using custom providers that are not provided by default in Cognito, you can pass an object to the `provider` parameter with the name of your custom provider.

```javascript
import { signInWithRedirect } from 'aws-amplify/auth';

const provider = {
custom: 'MyCustomOIDCProvider'
}

function handleSignInClick() {
signInWithRedirect({ provider })
}
```

### Deploy your backend environment with auth parameters for social sign-in

When you create or update your authentication configuration, Amplify will setup the configuration locally, but it does not automatically deploy the changes to your backend environment. You will need to run `amplify push` to deploy the changes to your backed environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Channels are logical group names that help you organize dispatching and listenin
Here is a basic example of setting up a listener that logs an event emitted through the `auth` channel:

```javascript
import { Hub } from 'aws-amplify';
import { Hub } from 'aws-amplify/utils';

const listener = (data) => {
console.log(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,32 @@ import flutter2 from '/src/fragments/lib/restapi/existing-resources.mdx';

<Fragments fragments={{ flutter: flutter2 }} />

import js3 from '/src/fragments/lib/restapi/js/existing-resources.mdx';
<InlineFilter filters={['javascript','angular','nextjs','react','vue','react-native']}>
Existing Amazon API Gateway resources can be used with the Amplify Libraries by calling `Amplify.configure()` with the API Gateway API name and options. Note, you will need to supply the full resource configuration and library options objects when calling `Amplify.configure()`. The following example shows how to configure additional API Gateway resources to an existing Amplify application:

<Fragments
fragments={{
javascript: js3,
angular: js3,
nextjs: js3,
react: js3,
vue: js3
}}
/>
```javascript
const existingConfig = Amplify.getConfig();

import rn4 from '/src/fragments/lib/restapi/js/existing-resources.mdx';
Amplify.configure({
...existingConfig,
API: {
...existingConfig.API,
REST: {
...existingConfig.API?.REST,
YourAPIName: {
endpoint:
'https://abcdefghij1234567890.execute-api.us-east-1.amazonaws.com/stageName',
region: 'us-east-1' // Optional
}
}
}
});
```

- **YourAPIName**: Friendly name for the API (e.g., _UsersAPI_)
- **endpoint**: The HTTPS endpoint of the API (e.g. _https://abcdefghij1234567890.execute-api.us-east-1.amazonaws.com/stageName_)
- **region**: AWS Region where the resources are provisioned (e.g. _us-east-1_). If not specified, the region will be inferred from the endpoint.

Note that before you can add an AWS resource to your application, the application must have the Amplify libraries installed. If you need to perform this step, see [Install Amplify Libraries](/[platform]/start/project-setup/create-application/#n2-install-amplify-libraries).

<Fragments fragments={{ 'react-native': rn4 }} />
</InlineFilter>
Loading
Loading