How to use the aws-amplify.configure function in aws-amplify

To help you get started, we’ve selected a few aws-amplify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codexstanford / techlist-frontend-web / src / store / utils / auth-client.js View on Github external
import Amplify, { Auth } from 'aws-amplify';
import { GraphQLClient } from 'graphql-request';
import { LOCAL_STORAGE_KEY, GET_USER_QUERY } from './const';

import { client } from '../apollo';

console.log('CLIENT', client);

Amplify.configure({
  Auth: {
    // identityPoolId: 'us-west-2:0de73b6e-0624-4f46-9e56-14e51ecf282a',
    region: 'us-west-2',
    userPoolId: 'us-west-2_uzyDC8Snl',
    userPoolWebClientId: '181177ggq1ot45s6t791vposkr',
    // cookieStorage: {
    //   domain: '.law.haus',
    //   path: '/',
    //   expires: 365,
    //   secure: true,
    // },
  },
});

const isBrowser = typeof window !== `undefined`;
github kkemple / journey / src / index.js View on Github external
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import Amplify from "aws-amplify";
import "normalize.css/normalize.css";

import "./index.css";
import amplifyConfig from "./aws-exports";

Amplify.configure(amplifyConfig);

ReactDOM.render(, document.getElementById("root"));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
github aws-samples / connected-drink-dispenser-workshop / dispenser_app / src / main.js View on Github external
import Vue from 'vue'
import App from './App.vue'
import store from './store.js';
import router from './router'
import vuetify from './plugins/vuetify'

Vue.config.productionTip = false

import Amplify, { API, Auth } from 'aws-amplify'
// import Amplify, * as AmplifyModules from 'aws-amplify'
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
import { AmplifyPlugin } from 'aws-amplify-vue'
import awsconfig from './aws-exports'

Amplify.configure(awsconfig)
API.configure(awsconfig)
Amplify.configure({
  ...awsconfig,
  API: {
    endpoints: [
      {
        name: "CDD_API",
        endpoint: awsconfig.cdd_api_endpoint,
        custom_header: async () => {
          // NOTE: The Id token is used instead of the access token since we cannot use CloudFormation
          // to add the resource server configuration and scopes directly. TODO: monitor CloudFormation
          // and CDK support to add
          return { Authorization: `Bearer ${(await Auth.currentSession()).getIdToken().getJwtToken()}` }
        }
      },
    ]
github aws-samples / amazon-cognito-example-for-external-idp / ui-react / src / index.tsx View on Github external
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './components/App';
import * as serviceWorker from './serviceWorker';
import {HttpAPIService} from "./service/APIService";
import Amplify, {API, Auth} from 'aws-amplify';
import amplifyConfig from './config/amplifyConfig';

Amplify.configure(amplifyConfig);

const apiService = new HttpAPIService(API, Auth);


ReactDOM.render(, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
github AJInteractive / InterviewJS / packages / composer / src / configureStore.js View on Github external
import { browserHistory } from "react-router";
import thunkMiddleware from "redux-thunk";
// import { persistStore, persistReducer } from "redux-persist";
// import storage from "redux-persist/lib/storage";

import Raven from "raven-js";
import createRavenMiddleware from "raven-for-redux";
import clone from "clone";

import rootReducer from "./reducers";
import awsmobile from "./aws-exports";

import stories from "./data/stories";

// AWS Mobile
Amplify.configure(awsmobile);

// Sentry.io
if (document.location.hostname !== "localhost") {
  Raven.config("https://796f1032b1c74f15aba70d91dfcd14c5@sentry.io/360335", {
    release: process.env.VERSION,
    autoBreadcrumbs: {
      xhr: false,
      console: false,
      dom: false,
    },
    maxBreadcrumbs: 32,
    sanitizeKeys: ["logo", "cover", "avatar"],
  }).install();
}

// // PERSIST
github aws-samples / aws-amplify-ionic-sample / src / main.ts View on Github external
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import Amplify from 'aws-amplify';
import awsmobile from './aws-exports';
Amplify.configure(awsmobile);

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.log(err));
github dabit3 / hype-beats / src / index.js View on Github external
import React from 'react';
import ReactDOM from 'react-dom';

import Amplify from 'aws-amplify'
import AWSAppSyncClient from 'aws-appsync'
import { Rehydrated } from 'aws-appsync-react'
import { ApolloProvider } from 'react-apollo'

import './index.css';
import Router from './Router';
import config from './aws-exports'

Amplify.configure(config)

const client = new AWSAppSyncClient({
  url: config.aws_appsync_graphqlEndpoint,
  region: config.aws_appsync_region,
  auth: {
    type: config.aws_appsync_authenticationType,
    apiKey: config.aws_appsync_apiKey
  }
});

window.LOG_LEVEL = "DEBUG"

const AppWithProvider = () => (
  
     (
github aws-samples / aws-bookstore-demo-app / assets / src / index.tsx View on Github external
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from "react-router-dom";
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import Amplify from "aws-amplify";
import config from "./config";

import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap-theme.css';

Amplify.configure({
  Auth: {
    mandatorySignIn: true,
    region: config.cognito.REGION,
    userPoolId: config.cognito.USER_POOL_ID,
    identityPoolId: config.cognito.IDENTITY_POOL_ID,
    userPoolWebClientId: config.cognito.APP_CLIENT_ID
  },
  API: {
    endpoints: [
      {
        name: "books",
        endpoint: config.apiGateway.API_URL,
        region: config.apiGateway.REGION
      },
      {
        name: "cart",
github aws-samples / aws-amplify-auth-starters / src / index.js View on Github external
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import config from './aws-exports'
import Amplify from 'aws-amplify'
Amplify.configure(config)

ReactDOM.render(, document.getElementById('root'));
registerServiceWorker();