Coder Social home page Coder Social logo

aws-amplify / docs Goto Github PK

View Code? Open in Web Editor NEW
470.0 76.0 977.0 778.83 MB

AWS Amplify Framework Documentation

Home Page: https://docs.amplify.aws

License: Apache License 2.0

JavaScript 1.50% TypeScript 4.44% Shell 0.01% SCSS 0.61% MDX 93.45%
aws-amplify serverless aws graphql fullstack aws-lambda

docs's Introduction

Amplify Documentation

DiscordChat

https://docs.amplify.aws

Prerequisites

Set up the docs repo

  1. Fork this repo and git clone it.
  2. In your terminal, navigate to the repo from where it was just cloned. This should be located at the /docs directory.
  3. From your command line, run yarn && yarn dev.
  4. http://localhost:3000/ should open automatically.

How to contribute

We welcome contributions to the documentation site! Here's how to do it:

  1. Follow our style guide, especially if writing longer pieces.
  2. Verify your changes locally.
  3. Make a PR to our main branch.
    1. Please include any issues your PR addresses.
    2. If any files have been deleted with your PR, please add the redirects required to redirects.json and ensure that the redirects-needed label has been added.
      • Please see the Amplify Hosting user guide for guidance on values and ordering.
      • Please note that there is a manual step for the Docs Engineering team to complete before the redirects are live.

What's next? After your PR is reviewed and all tests pass, it will be merged and the branch will be deleted.

Branches

  • main - at parity with our production site docs.amplify.aws
  • gh-pages - DO NOT DELETE!

Authoring pages

Our docs are generated using Next.js. Refer to their docs on how to create pages as a primer.

The source for each page is in src. This folder is the only directory you need to touch to edit or create pages.

The pages/index.tsx file located inside this folder will be rendered as a page at the route /. The pages//index.mdx** file will be rendered as a page at the route **/[platform]**.

To have the page render properly and display in the sidebar, place your page and its route in src/directory/directory.mjs.

IMPORTANT: Every page has to have a title, description, and platforms meta field and must import the getCustomStaticPaths util and export getStaticPaths and getStaticProps as shown in the example below:

import { getCustomStaticPath } from '@/utils/getCustomStaticPath';

export const meta = {
  title: 'Add social provider sign-in',
  description:
    'Learn how to set up social sign-in providers like Facebook, Google, Amazon, or Sign in with Apple.',
  platforms: [
    'javascript',
    'react-native',
    'flutter',
    'swift',
    'android',
    'angular',
    'nextjs',
    'react',
    'vue'
  ]
};

export const getStaticPaths = async () => {
  return getCustomStaticPath(meta.platforms);
};

export function getStaticProps(context) {
  return {
    props: {
      platform: context.params.platform,
      meta
    }
  };
}

The markdown body is parsed as MDX and can include any valid HTML or JSX.

Internal links

When linking to other pages within the docs.amplify.aws site, do not use relative links. For example, instead of [here is my link](../manage-mfa/), use [here is my link](/[platform]/build-a-backend/auth/manage-mfa/). Please note that when linking to a page with a pathname beginning with a platform—[platform] in the link—the URL will render conditionally based off the user's selected platform as a condition of the MDXLink component.

Fragments

To incorporate new platform-specific content within a page, please use Inline Filters.

When editing content that hasn't been migrated, you may see the following pattern:

import js from '/src/fragments/lib/datastore/js/conflict.mdx';

<Fragments
  fragments={{ javascript: js, angular: js, nextjs: js, react: js, vue: js }}
/>;

This pattern incorporates fragment files into a page and conditionally renders content based off selected platform added as a condition to the Fragments tag.

This fragment would exist in: src/fragments/lib/datastore/js/conflict.mdx

Inline Filters

We are incorporating the use of <InlineFilters> to add platform-specific content within the context of one page rather than in fragments. These filters allow you to still specify content by platform and they reference platforms using the same naming convention as our fragments. You can enclose your platform-specific content by updating the opening tag:

<InlineFilter filters={["javascript", "react-native", "angular", "nextjs", "react", "vue", "android", "swift", "flutter"]}>

</InlineFilter>

If you are updating content on a page, please note any inline filter tags which may be indicating a specific platform as you make your edits.

Accordion

Accordion – This single-use accordion hides peripheral content until the reader selects to expand the section. This helps you keep your pages focused on the need-to-know information upfront, while also providing readers an option to dive deeper when they choose. These accordions can provide peripheral content such as additional context for beginners, advanced deep dives for those who want to off-road, and troubleshooting guidance for errors users may encounter.

Here is an example of its usage:

<Accordion title='Review recommended accordion usage' headingLevel='4' eyebrow='Learn more'>

- Title – Make your title descriptive to help readers know what the accordion contains before they click.
- Eyebrow – Update this text to reflect the purpose of the accordion. We recommend:
  - Learn more – Used to add additional context that is not needed upfront but is useful for users to review when they choose.
  - Troubleshooting – Used when adding details to troubleshoot specific errors within context.
  - Walkthrough – Used when adding a step-by-step example for those who need more direct guidance.

</Accordion>

Tab-switchable Blocks

BlockSwitcher allows you to organize blocks of content into tabs. This is useful for presenting a reader different instructions based upon framework (e.g., Vue.js vs. React) or language (e.g., Java vs. Kotlin). Here's an example of its usage:

<BlockSwitcher>

<Block name="JavaScript">

```js
const a = 'a';
```

</Block>

<Block name="TypeScript">

```ts
const a: 'a' = 'a';
```

</Block>

<Block name="Rust">

```rust
let mut a = String::from("a");
```

</Block>

</BlockSwitcher>

Debug client-side code with browser developer tools

Prerequisites

To debug

  1. Set up the repo and run it with the dev script mentioned above in the "Getting Started" section.

  2. On your localhost page, go to the page with the React component you want to debug and open up the developer tools.

  3. To know which source file to breakpoint on, we need to find the name of the component first.

    • Open up the dev tools and use the React dev tools to find the component. Do this by using the "Select an element on the page to inspect it" tool under the "Components" tab.

    • Search for the variable/component name inside the source code to find the file you want to debug.

    • Place the breakpoint inside the file under the "Sources" tab in the browser's dev tools.

      • Note that since the Amplify Docs site is built with Next.js, file paths will start with "webpack://_N_E/./"
  4. Refresh your localhost site and the breakpoint should hit in the browser's dev tools. You should be able to debug the code.

Another way to find which file you want to debug is to search for strings/paragraphs seen in the Amplify docs site. Search for the strings in your code editor and you'll find that they will be in a .mdx file. You should see the components that are being rendered and be able to find the file name you want to debug.

More info on debugging can be found here: https://nextjs.org/docs/advanced-features/debugging

docs's People

Contributors

abdallahshaban557 avatar amplifiyer avatar brene avatar dabit3 avatar david-mcafee avatar eeatonaws avatar elorzafe avatar harrysolovay avatar haverchuck avatar hbuchel avatar heatheramz avatar hibler13 avatar jacoblogan avatar jordanranz avatar josefaidt avatar jpignata avatar katiegoines avatar kaustavghosh06 avatar mauerbac avatar mlabieniec avatar nikhil-dabhade avatar palpatim avatar powerful23 avatar renebrandel avatar sammartinez avatar swaminator avatar timngyn avatar tjleing avatar undefobj avatar ykethan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

API - Graphql - Simple query - code sample possibly in error

using this code from the samples:

// Simple query
const allEvents = await API.graphql(graphqlOperation(ListEvents));

resulted in the following webpack abend[1]::

> [email protected] build /Users/cssian/Projects/graphql/amplify-js-app
> webpack

Hash: a9eb109f3fa4ac5532a9
Version: webpack 4.20.2
Time: 82ms
Built at: 2018-10-09 15:44:50
         Asset      Size  Chunks             Chunk Names
main.bundle.js    29 KiB    main  [emitted]  main
    index.html  1.54 KiB          [emitted]
Entrypoint main = main.bundle.js
[./src/app.js] 302 bytes {main} [built] [failed] [1 error]

ERROR in ./src/app.js 9:21
Module parse failed: Can not use keyword 'await' outside an async function (9:21)
You may need an appropriate loader to handle this file type.
|
| // Simple query
> const allEvents = await API.graphql( graphqlOperation( ListEvents) );
| console.log( allEvents);

[1] 'abend' - abnormal end

More Pre-requisite Documentation

As I followed the CLI instructions for aws-amplify I kept getting authentication errors in relation to my aws user account. I had to create a couple policies on AWS IAM in order to have permission for CloudFormation and GraphQLApi.

I think it would be helpful to have a description of all the permissions necessary beforehand. It would be helpful in avoiding these authentication issues.

Adds docs for Auth.updateUserAttributes

Is your feature request related to a problem? Please describe.
I couldn't find any docs on the use of Auth.updateUserAttributes

Describe the solution you'd like
I would like to see a clear example of updating the mutable user properties and custom properties

AWS IOT - Pubsub subscribe got no response using amplify

Describe the bug
I have created ionic application with aws starter template. Did setup aws amplify from https://aws-amplify.github.io/
Also did completed setting up cognito link. I am able to signup and signin as well.
After SignIn , when i try to connect using this code :

PubSub.subscribe("myTopic").subscribe({ next: data => console.log('Message received', data), error: error => console.error(error), close: () => console.log('Done'), });

To Reproduce
Steps to reproduce the behavior:

  1. Setup Ionic and create a project using aws starter template
  2. Add aws amplify following documentation from website.
  3. Add Cognito feature.
  4. Now use PubSub to connect to AWS IOT
  5. No data received when subscribing. Nor on aws iot test console when publishing.

Expected behavior
Connection to aws iot should be made and data should be received on subscribing.

Desktop (please complete the following information):

  • OS: Linux - Kubuntu 18.04
  • Browser: Chrome
  • Version: 70.0.3538.67

Additional context

Additionaly , following document from aws amplify, PubSub.subscribe method uses 2 parameters, but when using in Ionic App , PubSub.subscribe require 3 parameters, third one being ProviderOptions.
What options are available , can't find them anywhere.

amplify and .gitignore

Describe the bug
The amplify <cmd> commands generate a slew of generated files/directories, where it is unclear which should be checked into source control and which ones shouldn't. I found this little nugget in the docs (via searching for .gitignore - not navigable via the menu system btw 👎) that specifies which files should be added to the .gitignore file. After updating it as outlined there and performing other amplify commands (e.g. init, add <something>, push, publish, etc.), there are still other files and changes that I'm unsure whether they should exist in source control or not:

  • .amplifyrc
  • amplify/.config/aws-info.json
  • amplify/.config/project-config.json
  • amplify/backend/auth/cognito.../...cloudformation-template.yml
  • amplify/backend/auth/cognito.../parameters.json
  • amplify/backend/awscloudformation/nested-cloudformation-stack.yml
  • amplify/backend/hosting/S3AndCloudFront/template.json
  • ...

Are the files above acceptable to be added to source control and/or are the docs updated to reflect the correct .gitignore files to be added?

To Reproduce
Steps to reproduce the behavior:

  1. amplify init, amplify add <something>, amplify push, etc.

Expected behavior
The files generated should be acceptable to check in to source control, after applying the necessary .gitignore updates.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS 10.13.6
  • Browser chrome
  • Version 70.0.3538.110

Smartphone (please complete the following information):
n/a

Additional context
none

amplify-s3-album not working for ionic

When I use the following code snippet, I get a null pointer exception:

<amplify-s3-album framework="Ionic" 
    path="pics" (selected)="onAlbumImageSelected($event)">
</amplify-s3-album>

Exception:

TypeError: Cannot read property 'provider' of undefined
    at StorageClass.<anonymous> (Storage.js:215)
    at step (Storage.js:44)
    at Object.next (Storage.js:25)
    at Storage.js:19
    at new ZoneAwarePromise (zone.js:891)
    at push../node_modules/@aws-amplify/storage/lib/Storage.js.__awaiter (Storage.js:15)
    at StorageClass.push../node_modules/@aws-amplify/storage/lib/Storage.js.StorageClass.list (Storage.js:212)
    at S3AlbumComponentIonic.push../node_modules/aws-amplify-angular/dist/src/components/storage/s3-album-component/s3-album.component.core.js.S3AlbumComponentCore.getList (s3-album.component.core.js:47)
    at S3AlbumComponentIonic.push../node_modules/aws-amplify-angular/dist/src/components/storage/s3-album-component/s3-album.component.core.js.S3AlbumComponentCore.ngOnInit (s3-album.component.core.js:39)
    at checkAndUpdateDirectiveInline (core.js:18537)

It's failing at this line at Storage.js:

                _a = (config.provider || {}).provider, provider = _a === void 0 ? DEFAULT_PROVIDER : _a;

It seems config is pointing to the option parameter. To avoid this issue, I had to set the option parameter to an empty object:

  <amplify-s3-album framework="Ionic" path="pictures" options="{level: 'public'}"
    (selected)="onAlbumImageSelected($event)"
    >
  </amplify-s3-album>

However, still the images do not show up. Any idea?

ERROR in node_modules/aws-sdk/lib/http_response.d.ts(1,25): error TS2307: Cannot find module 'stream'

Describe the bug
I was following the instructions in the following tutorial:
https://aws-amplify.github.io/docs/js/start?platform=ionic
After I ran the command 'amplify publish', I got the following error:

ERROR in node_modules/aws-sdk/lib/http_response.d.ts(1,25): error TS2307: Cannot find module 'stream'.
node_modules/aws-sdk/lib/http_response.d.ts(14,18): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i @types/node.

I had to follow the instruction below to fix the issue:

https://stackoverflow.com/questions/43017736/integrating-aws-sdk-to-angular2-gives-cannot-find-module-stream

Adding "node" to types in tsconfig.app.json file that the angular-cli creates in the src directory as below:

{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "",
"types": ["node"]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

I'm using mac:

$ npm -v
6.4.1
$ node -v
v10.14.1

Android doc issues regarding the drop in auth UI

Describe the bug
Android drop in UI doc inconsistencies

To Reproduce
Steps to reproduce the behavior:
Docs here: https://aws-amplify.github.io/docs/android/authentication#drop-in-auth

Expected behavior

AWSMobileClient.getInstance().showSignIn(this, SignInUIOptions.builder().build());
In the above code you would have created an Android Activity called NextActivity which would automatically be navigated to upon successful sign-up and sign-in. For testing, you can alternatively just use MainActivity.class after initializing….

Expected: In the "above code" there's no mention of "NextActivity". We should have the docs corrected.

  1. nextActivityClass has been renamed to "nextActivity" in the library so our docs should reflect that (one use here, another under the "Customization" section).

  2. SIGNED_OUT block in the switch statement: AWSMobileClient.getInstance().showSignIn(MainActivity.this, MainActivity.class) doesn't compile any more because of the SignInUIOption.

Desktop (please complete the following information):

  • OS: Android
  • Version: SDK 2.8.0

Auth.signUp documentation should provide an example output

Is your feature request related to a problem? Please describe.
In reading these docs, we see,
Auth.signUp( ... ).then(data => console.log(data)) which doesnt really mention what type of data we get back, what to expect there, i'm having trouble getting the user ID / key / userSub thing, and it would be useful to have a copy of what these functions return instead of a vague variable "data"

Describe the solution you'd like
I think it would be helpful for everyone who uses Amplify Auth if those docs included more detail on what is returned by each method of the Auth object. Which step gets the "user" object? How do you verify the user email to complete signup? If you have to log the user in in order to verify the email, how the hell does that make sense with security? How do you log the user to verify email, if they shouldnt be logging in at all, because they never verified their email?

Describe alternatives you've considered
Google Cloud Platform, Firebase Auth, Passport.js, Auth0

Additional context
I just want to sign up my users in 1 step, so I don't have to waste more time on Amplify / Cognito Auth issues any more

Clarification needed on how to prevent Authenticator from pre-rendering component

The documentation isn't clear on how to configure an Authenticator component so that the content it wraps is only rendered after a successful login.

The documentation can be found here: https://aws-amplify.github.io/docs/js/authentication#show-your-app-after-sign-in

Specifically, the part of this that isn't clear is

Using the options above, to control the condition for Authenticator to render App component, simply set _validAuthStates property:

this._validAuthStates = ['signedIn'];

Then, in the component’s constructor, implement showComponent(theme) {} in lieu of the typical render() {} method.

Where is this._validAuthStates=['signedIn'] supposed to be written/set? Additionally, where can any further documentation on swapping showComponent(theme) {} instead of render() be found?

Any help would be appreciated. In fact, if someone can provide clarification I will submit a PR that updates the documentation.

Cognito email uniqueness

Hi,
For the command amplify add auth, the Cognito email uniqueness configuration should be the default one. It is not.
With that :
UsernameAttributes:
- "email"

How to: Automatic/programmable push notifications

Is your feature request related to a problem? Please describe.
Handling automatic push notifications seems to require somewhat hacky solutions. I have not been able to find a conventional approach to handle these notifications within amplify/ AWS mobile.

Describe the solution you'd like
A tutorial or article explaining the conventional solution to automatic push notifications within amplify/AWS mobile suite.

Describe alternatives you've considered
Based on tutorials and articles I've pieced together a solution. Something like:
track if user is online/offline -> use appsync local resolver to catch desired notification and send to lambda -> use lambda to generate a 1-time pinpoint message.

Thanks in advance.

Drop-in UI for AWSMobileClient - Can't change the logo image (2.7.0)

Describe the bug
A clear and concise description of what the bug is.
Hi! I'm a IOS developer that uses the drop-in auth ui. According to https://aws-amplify.github.io/docs/ios/authentication the logo can be changed easily through passing a UIImage to the AWSMobileClient.sharedInstance()
.showSignIn() function. This does not work however. The default logo always shows up. My code looks as follows:
if(AWSMobileClient.sharedInstance().isSignedIn == false){ AWSMobileClient.sharedInstance().showSignIn(navigationController: self.navigationController!, signInUIOptions: SignInUIOptions(canCancel: true, logoImage: UIImage(named: "Icon-Small"), backgroundColor: UIColor.black), { (result, error) in if(error == nil){ //Successful signin print("now logged in") } }) }

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
The default logo should be replaced by the custom image.
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]
    Iphone X

Additional context
Add any other context about the problem here.

Pinpoint configuration mobiletargeting:PutEvents action does not exist

I am following this guide: https://aws-amplify.github.io/docs/js/analytics

When creating the policy specified in this guide:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "mobiletargeting:UpdateEndpoint",
                "mobiletargeting:PutEvents"
            ],
            "Resource": [
                "arn:aws:mobiletargeting:*:${accountID}:apps/${appId}*"
            ]
        }
    ]
}

Using the IAM Management Console in AWS to create this policy, it reports that the mobiletargeting:PutEvents action does not exist.

What action are we supposed to use here?

Bad link to "Cloud API" in REST PUT docs

Describe the bug

In the docs for API > REST > PUT:

PUT

When used together with Cloud API, PUT method can be used to create or update records. It updates the record if a matching record is found. Otherwise, a new record is created.

The Cloud API link is bad: https://docs.aws.amazon.com/aws-mobile/latest/developerguide/web-access-apis.html

It just redirects back to the main docs page.

To Reproduce

  1. Go to API > REST > PUT
  2. Click on Cloud API
  3. See page it leaves you on

Expected behavior

I would expect this to go to a meaningful page that explains what the "Cloud API" is.

Additional context

Separately it’d be great to see more examples (maybe tutorials) for setting up both AppSync and Rest integrations that goes into the backend part of the implementation.

Rehydrated reason for use

Is your feature request related to a problem? Please describe.
Was looking for a reason that Rehydrated is needed

Describe the solution you'd like
https://tylermcginnis.com/building-serverless-react-graphql-apps-with-aws-appsync/

Rehydrated will wait until the application cache has been read and is ready to use in the app before rendering the app. By default, this just shows some loading text, but this can be configured with our own UI like this if we would like:

https://hackernoon.com/aws-appsync-up-and-running-560a42d96ba7

Rehydrated is a helper from the aws-appsync-react library that will basically wait to render the application until the data is fetched from the API and the application is wired up with the AWSAppSyncClient

Describe alternatives you've considered
See links above

Additional context
Please include some text and an example of why and how to use.

Split the React and React Native documentation. Usage and Setup are really confusing.

Is your feature request related to a problem? Please describe.
It is very frustrating and confusing to try to get started with AWS amplify when building for react native, as the documentation does not make it clear on many accounts what work for react and what works for React Native. A lot of the examples error when trying them in React Native. I have so far spent several days making very little progress.

Describe the solution you'd like
Separate documentation for React and React Native. Even though they are similar languages they are very much not the same.

Describe alternatives you've considered
Scrapping AWS Amplify and using Firebase instead.

Additional context
Particularly full, working examples of custom UI and Authenticators you can try out. https://aws-amplify.github.io/amplify-js/media/authentication_guide.html#create-your-own-ui is not a working example. It should be changed to something you can just copy paste to try out.

Federated with Auth0 docs show incorrect use of expiresIn

Federated with Auth0 documentation shows pseudo code with misleading/wrong use of expiresIn. The expiresIn property returned from auth0 is the validity duration of the opaque access_token NOT the idToken!

The idToken has it's own expiry which is configurable via the Auth0 dashboard and is encoded into the idToken's exp field.

This is a more correct example showing decoding the token to read the expiry correctly.

import jwtDecode from 'jwt-decode';

const { idToken, domain, name, email } = getFromAuth0(); // get the user credentials and info from auth0

Auth.federatedSignIn(
    domain, // The Auth0 Domain,
    {
        token: idToken,
        expires_at: decodeToken(idToken).exp * 1000 // the expiration timestamp
    },
    { 
        name, 
        email
    } // the user object, e.x. { name: username, email: email }
).then(cred => {
    console.log(cred);
});

Improve Pinpoint notification docs

From PR #82, @undefobj commented:

I think this is good however one thing I would like to add in the next pass is a "How it works" for the Pinpoint Analytics stuff. For instance in the Kinesis section we talk about why we stream to disk with a PutRecord but we don't talk about the same in Pinpoint. We do talk about managing sessions but we don't really talk about why they're useful aside from "Indicate when and how often users open and close your app" which isn't completely accurate as sessions can be impacted by backgrounding, or another app (like a text message) popping up. Also for both the Pinpoint and Kinesis stuff if we are batching to disk, when does the record actually get sent up to the service? Is it when network connectivity resumes or at another scheduled time?

Update withAuthenticator customization in docs

The docs on the below link fail to list RequireNewPassword after ForgotPassword on the list of attributes that need to be sent in.

If a developer fails to include this, their application will fail in the event that the user requires a new password, e.g., user was sent an auto generated password.

If there are any other sections that are required, it would be a good idea to include them if they're currently not documented.

https://aws-amplify.github.io/amplify-js/media/authentication_guide.html#customize-withauthenticator

amplify push should not change cloudformations

Hi,
The fact to add a new amplify service apparently modifies the existing cloudformation of other services.
It should not be, because I want to keep my changes. When I added a service, that has changed my existing auth cloudformation (modified for email uniqueness).

`AWSMobileClient.sharedInstance()` does not have `getTokens` function.

Describe the bug
The following example from https://aws-amplify.github.io/docs/ios/api does not work:

    func initializeAppSync() {
        // You can choose your database location, accessible by the SDK
        let databaseURL = URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent("todos_db")
        
       do {
            // Initialize the AWS AppSync configuration
            let appSyncConfig = try AWSAppSyncClientConfiguration(
                appSyncClientInfo: AWSAppSyncClientInfo(),
                userPoolsAuthProvider: {
                    class MyCognitoUserPoolsAuthProvider : AWSCognitoUserPoolsAuthProviderAsync {
                        func getLatestAuthToken(_ callback: @escaping (String?, Error?) -> Void) {
                            AWSMobileClient.sharedInstance().getTokens { (tokens, error) in
                                if error != nil {
                                    callback(nil, error)
                                } else {
                                    callback(tokens?.idToken?.tokenString, nil)
                                }
                            }
                        }
                    }
                    return MyCognitoUserPoolsAuthProvider()}(),
                databaseURL:databaseURL)
            
            // Initialize the AWS AppSync client
            appSyncClient = try AWSAppSyncClient(appSyncConfig: appSyncConfig)
        } catch {
            print("Error initializing appsync client. \(error)")
        }
    }

AWSMobileClient.sharedInstance() does not have getTokens function.

I'm using the following latest dependencies installed just today:

Using AWSAuthCore (2.6.18)
Using AWSAuthUI (2.6.18)
Using AWSCognitoIdentityProvider (2.6.18)
Using AWSCognitoIdentityProviderASF (1.0.1)
Using AWSCore (2.6.18)
Using AWSMobileClient (2.6.18)

To Reproduce
Follow the steps in https://aws-amplify.github.io/docs/ios/api on a new project.

Expected behavior
The example should have worked.

Screenshots
screen shot 2018-12-01 at 9 34 52 pm

Desktop (please complete the following information):

  • OS: iOS
  • Version: 12

Smartphone (please complete the following information):

  • Device: iPhone X Max
  • OS: iOS12

ReactNative JWT and User data not encrypted (via ASyncStorage)

Hi,

We noticed that JWT- and user data is stored via ASyncStrorage on the device. With this implementation we conclude that the credentials are not secure (e.g. in comparison to storing a JWT token in the Keychain on iOS).

You have situations were phones get stolen or and/or backups are in hands of others. In that case, the data is not encrypted and could be retrieved.

Could you please elaborate how amplify takes care of this, I hope we miss something as security is a high priority of aws. A brief documentation or best practice would be very appreciated.

Thanks you very much.

Context of this issue:

  • We use React Native (latest versions)
  • Applies to iOS as well for Android

Example class for Managing Security Tokens is incomplete or more information need to be added.

Describe the bug
In the section
https://aws-amplify.github.io/docs/js/authentication#managing-security-tokens
that describes class MyStorage it is stated

you need to sync those items into the memory in this method

    // If the storage operations are async(i.e AsyncStorage)
    // Then you need to sync those items into the memory in this method
    static sync(): Promise<void>;

How is this supposed to be done?
You can't use async storage unless you know how to do this.
You can look for other solutions to bridge the gap between sync/async which means that you might not use the provided sync() method.
The general description of class MyStorage is straight forward.

I have found this
https://github.com/aws-amplify/amplify-js/blob/4644b432/packages/core/src/StorageHelper/reactnative.ts#L66
Would that serve as an example implementation?
If so, then the documentation needs updating

Expected behavior
A clear and concise example and description of what you are expected to do.

amplify hosting proposal

Hi,
I think amplify add hosting is incomplete.
It should link cloudfront to a domain with https, redirect non-www to www and link a CodeCommit repository to automate continuous deployments.

Add the bucket policy if you are uploading images for publix

Suggest include public access policy so the images you upload become available.

{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "AllowPublicRead",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your_bucket_name/public/*"
    }
  ]
}

Code blocks should have a horizontal scroll bar

Is your feature request related to a problem? Please describe.
Where ever there is a code block showing example implementation, some of the example code is longer than the width of the code block and requires horizontal scrolling. The current code blocks do not allow for horizontal scrolling, which makes viewing the code difficult.

Describe the solution you'd like
The simplest solution is to allow the code block to scroll horizontally.

Describe alternatives you've considered
The optimal solution is to use a feature-rich code viewer, such as the Monaco Editor (powered by VS Code). This will allow viewers to choose how they would like to view the code, such as wrapped, reduced size, etc.

Additional context
image

on mobile view (or narrow desktop view) scrolling "jumps" up when getting close to the bottom

Describe the bug

If you scroll all the way down in any doc page (e.g. https://aws-amplify.github.io/docs/js/ionic) and the width is about half screen width on a Mac (tried on chrome, macOS Sierra, 13-inch). When you try to get all the way to the bottom, some script seems to trigger it to go up again. Very small issue, but when you have the docs side by side with the editor, this can be quite important :)

To Reproduce
Steps to reproduce the behavior:

  1. Go to any doc page, e.g. https://aws-amplify.github.io/docs/js/ionic
  2. Resize window so that the left nav bar is collapsing
  3. Scroll down to the bottom

Expected behavior

Reach the bottom

Screenshots
If applicable, add screenshots to help explain your problem.

screen capture.zip

Desktop (please complete the following information):

  • OS: macOS Sierra
  • Browser: chrome
  • Version: 70.0.3538.110

Non-resolvable function in the Android Authentication tutorial

Describe the bug
I followed the guide for making an Android appUI from "Getting started" to Authentication - the Drop-In UI describes a non-existing function signature:

AWSMobileClient.getInstance().showSignIn(this);

This function call also requires a SignInUIOptions parameter.

Algolia dropdown not usable

Describe the bug
The items in the algolia search dropdown are cropped/clipped and therefore not readable

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://aws-amplify.github.io/
  2. Type something in the search field in the upper right
  3. Wait for the suggestions dropdown
  4. See error

Expected behavior
Readable links

Screenshots
bildschirmfoto 2018-11-17 um 07 57 08

Desktop (please complete the following information):

  • OS: macOS Sierra
  • Browser: Chrome
  • Version: 70.0.3538.102

AWS amplify is just uber confusing. I was up and running with Firebase in 30 minutes.

I have to admit, AWS Amplify is confusing, just as Cognito is, the effort and time to get up and running is huge (putting off many people). I'm still trying to work out how to do things. All I wanted was to use the authorisation and authentication of AWS Amplify. I have ran the various commands amplify configure and init (which took a while to find on the site). All I know is some stack has been created and there is a user with full admin rights that has also been created! I look at cognito, i see no user pools or anything. Think I have spent the whole day on this now, getting very tempted to switch back to Firebase, sorry to say it was minutes with firebase.

Doc down Storage.put return type more explicitly

Is your feature request related to a problem? Please describe.
From https://aws-amplify.github.io/docs/js/storage#put, there are code snippets like Storage.put(...).then(result => console.log(result)), but they don't present a clear idea that Storage.put(...) returns a {key: S3 object key} on success. Even in API references, this is not made explicit. One has to look into the code to figure this out.

Describe the solution you'd like
Doc down the return type more explicitly.

Additional context
Working on a pull request.

Moved from aws-amplify/amplify-js#2141

Federated Sign In for iOS

https://aws-amplify.github.io/docs/ios/authentication
Under Section: Federated Sign In

First snippet of code provided here has two issues.
AWSMobileClient.sharedInstance().federatedSignIn(providerName: IdentityProviders.facebook.rawValue, token: "FACEBOOK_TOKEN_HERE") { (userState, err) in
if let error = error {
print("Federated Sign In failed: (error.localizedDescription)")
}
}

  1. IdentityProviders.facebook.rawValue should be IdentityProvider.facebook.rawValue
  2. if let error = error should be if let error = err

i.util.crypto.lib.randomBytes is not a function

Describe the bug
In the react add api section, when you go to confirm in the AppSync Console you have to log in.
Logging returns this error ".util.crypto.lib.randomBytes is not a function"

Expected behavior
Expected that you log in successfully

Screenshots
If applicable, add screenshots to help explain your problem.
screen shot 2018-12-07 at 10 03 42 am

  • client id from Cognito

screen shot 2018-12-07 at 10 05 01 am

Desktop (please complete the following information):

PrisBook:~$ macnodeyarnv
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G3025
yarn version: 1.10.1
node version: v9.10.1

Documentation bug in instruction for adding amplify-authenticator

The documentation at https://aws-amplify.github.io/docs/js/ionic states:

"To use Authenticator, just add the amplify-authenticator directive in your .html view

  ...
  <amplify-authenticator framework="Ionic"></amplify-authenticator>
  ...

"

However, when I did this I go the following error:

'amplify-authenticator' is not a known element:

I had to add the following so that the error goes away:

...
import { AmplifyAngularModule, AmplifyIonicModule, AmplifyService } from 'aws-amplify-angular' // Added by me
...
@NgModule({
  imports: [
...
    AmplifyAngularModule, // Added by me
    AmplifyIonicModule,   // Added by me
...

If you search the Internet, you will see that I'm not the only one facing this issue, the documentation needs to be fixed.

Android Docs issue with initializing the AWSAppSyncClient

Describe the bug
The code referred to in the docs doesn't compile, seems to be a library update.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://aws-amplify.github.io/docs/android/api#cognito-user-pools

This block where it initializes the AWSAppSyncClient:
return AWSMobileClient.getInstance().getTokens().getIdToken().getJWTToken();
doesn't quite work.

Expected behavior
Should be
return AWSMobileClient.getInstance().getTokens().getIdToken().getTokenString();

Smartphone (please complete the following information):

  • OS: Android SDK
  • Version: 2.8.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.